summaryrefslogtreecommitdiffstats
path: root/Bugzilla.pm
diff options
context:
space:
mode:
authormkanat%bugzilla.org <>2007-03-15 10:29:45 +0100
committermkanat%bugzilla.org <>2007-03-15 10:29:45 +0100
commit496ad3d1ff432cd04ee3a1a6c90d38e61450d606 (patch)
treeebc6ab41906ff0404b631ca09b0d4323219f1eda /Bugzilla.pm
parentedd47c05d21853caa46e9f95ca7e1504f215216f (diff)
downloadbugzilla-496ad3d1ff432cd04ee3a1a6c90d38e61450d606.tar.gz
bugzilla-496ad3d1ff432cd04ee3a1a6c90d38e61450d606.tar.xz
Bug 374004: Enable transaction code and use it in some installation places
Patch By Max Kanat-Alexander <mkanat@bugzilla.org> (module owner) a=mkanat
Diffstat (limited to 'Bugzilla.pm')
-rw-r--r--Bugzilla.pm11
1 files changed, 6 insertions, 5 deletions
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;
}