summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Error.pm
diff options
context:
space:
mode:
authorlpsolit%gmail.com <>2008-01-28 02:15:18 +0100
committerlpsolit%gmail.com <>2008-01-28 02:15:18 +0100
commitc0b4d49d2ed629ccba8c5fc0d61ebf28972d6ada (patch)
treef181f794f5ae4c38a5e10a1b57fd06fa2d21576d /Bugzilla/Error.pm
parentce3089f58a6edcb4074df97d1e6133d55b04377a (diff)
downloadbugzilla-c0b4d49d2ed629ccba8c5fc0d61ebf28972d6ada.tar.gz
bugzilla-c0b4d49d2ed629ccba8c5fc0d61ebf28972d6ada.tar.xz
Bug 121069: Remove $dbh->bz_(un)lock_tables from process_bug.cgi and Error.pm in favor of DB transactions. These methods are no longer used and are completely removed now - Patch by Frédéric Buclin <LpSolit@gmail.com> r/a=mkanat
Diffstat (limited to 'Bugzilla/Error.pm')
-rw-r--r--Bugzilla/Error.pm15
1 files changed, 7 insertions, 8 deletions
diff --git a/Bugzilla/Error.pm b/Bugzilla/Error.pm
index 18f9aae54..3e5688e2a 100644
--- a/Bugzilla/Error.pm
+++ b/Bugzilla/Error.pm
@@ -46,16 +46,15 @@ sub _in_eval {
sub _throw_error {
my ($name, $error, $vars) = @_;
-
+ my $dbh = Bugzilla->dbh;
$vars ||= {};
$vars->{error} = $error;
- # Make sure any locked tables are unlocked
- # and the transaction is rolled back (if supported)
- # If we are within an eval(), do not unlock tables as we are
+ # Make sure any transaction is rolled back (if supported).
+ # If we are within an eval(), do not roll back transactions as we are
# eval'uating some test on purpose.
- Bugzilla->dbh->bz_unlock_tables(UNLOCK_ABORT) unless _in_eval();
+ $dbh->bz_rollback_transaction() if ($dbh->bz_in_transaction() && !_in_eval());
my $datadir = bz_locations()->{'datadir'};
# If a writable $datadir/errorlog exists, log error details there.
@@ -124,10 +123,10 @@ sub ThrowCodeError {
sub ThrowTemplateError {
my ($template_err) = @_;
+ my $dbh = Bugzilla->dbh;
- # Make sure any locked tables are unlocked
- # and the transaction is rolled back (if supported)
- Bugzilla->dbh->bz_unlock_tables(UNLOCK_ABORT);
+ # Make sure the transaction is rolled back (if supported).
+ $dbh->bz_rollback_transaction() if $dbh->bz_in_transaction();
my $vars = {};
if (Bugzilla->error_mode == ERROR_MODE_DIE) {