From: lpsolit%gmail.com <> Date: Mon, 8 Oct 2007 04:24:46 +0000 (+0000) Subject: Bug 398707: whine.pl should use transactions for database interaction - Patch by... X-Git-Tag: bugzilla-3.1.3~512 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=bd370f377168cc55ff33240a16d574bf7982b5a5;p=thirdparty%2Fbugzilla.git Bug 398707: whine.pl should use transactions for database interaction - Patch by Emmanuel Seyman r/a=mkanat --- diff --git a/whine.pl b/whine.pl index 82bfc933b3..a809025c09 100755 --- 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')) {