summaryrefslogtreecommitdiffstats
path: root/userprefs.cgi
diff options
context:
space:
mode:
authorlpsolit%gmail.com <>2007-11-15 05:56:31 +0100
committerlpsolit%gmail.com <>2007-11-15 05:56:31 +0100
commit0dadaed4ffb582ccfbc2356e7715007819d1cea2 (patch)
treea44cf83a9670d0a5e2ebc63a1dcc27a012924fc1 /userprefs.cgi
parentec38a93e110be22f7316871994f91dc53712bcd2 (diff)
downloadbugzilla-0dadaed4ffb582ccfbc2356e7715007819d1cea2.tar.gz
bugzilla-0dadaed4ffb582ccfbc2356e7715007819d1cea2.tar.xz
Bug 403824: Replace table locks in most Bugzilla files with transactions - Patch by Emmanuel Seyman <eseyman@linagora.com> r/a=mkanat
Diffstat (limited to 'userprefs.cgi')
-rwxr-xr-xuserprefs.cgi12
1 files changed, 4 insertions, 8 deletions
diff --git a/userprefs.cgi b/userprefs.cgi
index e2cc2e0ce..57cbd4c21 100755
--- a/userprefs.cgi
+++ b/userprefs.cgi
@@ -255,7 +255,7 @@ sub SaveEmail {
###########################################################################
# Role-based preferences
###########################################################################
- $dbh->bz_lock_tables("email_setting WRITE");
+ $dbh->bz_start_transaction();
# Delete all the user's current preferences
$dbh->do("DELETE FROM email_setting WHERE user_id = ?", undef, $user->id);
@@ -302,7 +302,7 @@ sub SaveEmail {
}
}
- $dbh->bz_unlock_tables();
+ $dbh->bz_commit_transaction();
###########################################################################
# User watching
@@ -311,11 +311,7 @@ sub SaveEmail {
&& (defined $cgi->param('new_watchedusers')
|| defined $cgi->param('remove_watched_users')))
{
- # Just in case. Note that this much locking is actually overkill:
- # we don't really care if anyone reads the watch table. So
- # some small amount of contention could be gotten rid of by
- # using user-defined locks rather than table locking.
- $dbh->bz_lock_tables('watch WRITE', 'profiles READ');
+ $dbh->bz_start_transaction();
# Use this to protect error messages on duplicate submissions
my $old_watch_ids =
@@ -356,7 +352,7 @@ sub SaveEmail {
}
}
- $dbh->bz_unlock_tables();
+ $dbh->bz_commit_transaction();
}
}