diff options
author | lpsolit%gmail.com <> | 2007-11-19 02:23:54 +0000 |
---|---|---|
committer | lpsolit%gmail.com <> | 2007-11-19 02:23:54 +0000 |
commit | 68312cf980e2b7d7f55d48fd9102d8480404a1a6 (patch) | |
tree | ce89937c30cc30ff45ecab8c488d59323e481b06 /votes.cgi | |
parent | Bug 399163: Bugzilla/*.pm should use transactions for database interaction - ... (diff) | |
download | bugzilla-68312cf980e2b7d7f55d48fd9102d8480404a1a6.tar.gz bugzilla-68312cf980e2b7d7f55d48fd9102d8480404a1a6.tar.bz2 bugzilla-68312cf980e2b7d7f55d48fd9102d8480404a1a6.zip |
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-x | votes.cgi | 6 |
1 files changed, 2 insertions, 4 deletions
@@ -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 }; |