]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 398707: whine.pl should use transactions for database interaction - Patch by...
authorlpsolit%gmail.com <>
Mon, 8 Oct 2007 04:24:46 +0000 (04:24 +0000)
committerlpsolit%gmail.com <>
Mon, 8 Oct 2007 04:24:46 +0000 (04:24 +0000)
whine.pl

index 82bfc933b3e2fded9d0fac405cc83831548b7c07..a809025c09e9e2bc0b8b9445a827e6b928c4de7e 100755 (executable)
--- a/whine.pl
+++ b/whine.pl
@@ -206,12 +206,7 @@ sub get_next_event {
     # Loop until there's something to return
     until (scalar keys %{$event}) {
 
-        $dbh->bz_lock_tables('whine_schedules WRITE',
-                             'whine_events READ',
-                             'profiles READ',
-                             'groups READ',
-                             'group_group_map READ',
-                             'user_group_map READ');
+        $dbh->bz_start_transaction();
 
         # Get the event ID for the first pending schedule
         $sth_next_scheduled_event->execute;
@@ -275,7 +270,7 @@ sub get_next_event {
             reset_timer($sid);
         }
 
-        $dbh->bz_unlock_tables();
+        $dbh->bz_commit_transaction();
 
         # Only set $event if the user is allowed to do whining
         if ($owner->in_group('bz_canusewhines')) {