From: Michael Andreen Date: Sat, 20 Jan 2007 12:58:13 +0000 (+0000) Subject: connection to db is done in handler, so should do potential rollback and disconnect... X-Git-Url: https://ruin.nu/git/?a=commitdiff_plain;h=a5ecd18d276ae1a43b92d96e2347a077a1a52427;hp=f2afeb99392df14a06b6236d843602d62c0261f2;p=ndwebbie.git connection to db is done in handler, so should do potential rollback and disconnect there too --- diff --git a/ND.pm b/ND.pm index 50629e8..28bd90e 100755 --- a/ND.pm +++ b/ND.pm @@ -46,6 +46,9 @@ sub handler { $page = ND::Web::Page->new(PAGE => $page, DBH => $ND::DBH, URI => $ENV{REQUEST_URI}); $page->render; + $ND::DBH->rollback unless $ND::DBH->{AutoCommit}; + $ND::DBH->disconnect; + return Apache2::Const::OK; } diff --git a/ND/Web/XMLPage.pm b/ND/Web/XMLPage.pm index 2a876a4..561fdc8 100644 --- a/ND/Web/XMLPage.pm +++ b/ND/Web/XMLPage.pm @@ -125,11 +125,6 @@ sub render : method { my $output = $template->output; print header(-type=> $type, -charset => 'utf-8', -Content_Length => length $output); print $output; - - - $DBH->rollback unless $DBH->{AutoCommit}; - $DBH->disconnect; - }; 1;