From 68312cf980e2b7d7f55d48fd9102d8480404a1a6 Mon Sep 17 00:00:00 2001 From: "lpsolit%gmail.com" <> Date: Mon, 19 Nov 2007 02:23:54 +0000 Subject: Bug 403834: Replace table locks with database transactions in tokens, votes, and sanitycheck - Patch by Emmanuel Seyman r/a=mkanat --- votes.cgi | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'votes.cgi') diff --git a/votes.cgi b/votes.cgi index 4b26229a5..9dc728ef8 100755 --- a/votes.cgi +++ b/votes.cgi @@ -294,9 +294,7 @@ sub record_votes { # for products that only allow one vote per bug). In that case, we still # need to clear the user's votes from the database. my %affected; - $dbh->bz_lock_tables('bugs WRITE', 'bugs_activity WRITE', - 'votes WRITE', 'longdescs WRITE', - 'products READ', 'fielddefs READ'); + $dbh->bz_start_transaction(); # Take note of, and delete the user's old votes from the database. my $bug_list = $dbh->selectcol_arrayref('SELECT bug_id FROM votes @@ -335,7 +333,7 @@ sub record_votes { my $confirmed = CheckIfVotedConfirmed($id, $who); push (@updated_bugs, $id) if $confirmed; } - $dbh->bz_unlock_tables(); + $dbh->bz_commit_transaction(); $vars->{'type'} = "votes"; $vars->{'mailrecipients'} = { 'changer' => Bugzilla->user->login }; -- cgit v1.2.3-24-g4f1b