From 496ad3d1ff432cd04ee3a1a6c90d38e61450d606 Mon Sep 17 00:00:00 2001 From: "mkanat%bugzilla.org" <> Date: Thu, 15 Mar 2007 09:29:45 +0000 Subject: Bug 374004: Enable transaction code and use it in some installation places Patch By Max Kanat-Alexander (module owner) a=mkanat --- Bugzilla.pm | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'Bugzilla.pm') diff --git a/Bugzilla.pm b/Bugzilla.pm index f278adb2e..473d959fc 100644 --- a/Bugzilla.pm +++ b/Bugzilla.pm @@ -412,14 +412,15 @@ sub request_cache { # Private methods -# Per process cleanup +# Per-process cleanup sub _cleanup { - - # When we support transactions, need to ->rollback here my $main = request_cache()->{dbh_main}; my $shadow = request_cache()->{dbh_shadow}; - $main->disconnect if $main; - $shadow->disconnect if $shadow && Bugzilla->params->{"shadowdb"}; + foreach my $dbh ($main, $shadow) { + next if !$dbh; + $dbh->bz_rollback_transaction() if $dbh->bz_in_transaction; + $dbh->disconnect; + } undef $_request_cache; } -- cgit v1.2.3-24-g4f1b