summaryrefslogtreecommitdiffstats
path: root/votes.cgi
diff options
context:
space:
mode:
authorlpsolit%gmail.com <>2007-11-19 03:23:54 +0100
committerlpsolit%gmail.com <>2007-11-19 03:23:54 +0100
commit68312cf980e2b7d7f55d48fd9102d8480404a1a6 (patch)
treece89937c30cc30ff45ecab8c488d59323e481b06 /votes.cgi
parent9d6205cdb651fe3769ac58f03068dedb68e7689a (diff)
downloadbugzilla-68312cf980e2b7d7f55d48fd9102d8480404a1a6.tar.gz
bugzilla-68312cf980e2b7d7f55d48fd9102d8480404a1a6.tar.xz
Bug 403834: Replace table locks with database transactions in tokens, votes, and sanitycheck - Patch by Emmanuel Seyman <eseyman@linagora.com> r/a=mkanat
Diffstat (limited to 'votes.cgi')
-rwxr-xr-xvotes.cgi6
1 files changed, 2 insertions, 4 deletions
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 };