From c0b4d49d2ed629ccba8c5fc0d61ebf28972d6ada Mon Sep 17 00:00:00 2001 From: "lpsolit%gmail.com" <> Date: Mon, 28 Jan 2008 01:15:18 +0000 Subject: 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 r/a=mkanat MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Bugzilla/Error.pm | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'Bugzilla/Error.pm') 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) { -- cgit v1.2.3-24-g4f1b