Repair clear holds shelf transaction timeout user/berick/clear-shelf-xact-timeout-repair
authorBill Erickson <berick@esilibrary.com>
Tue, 26 Feb 2013 19:33:58 +0000 (14:33 -0500)
committerBill Erickson <berick@esilibrary.com>
Tue, 26 Feb 2013 19:33:58 +0000 (14:33 -0500)
Initiate our cstore transaction after making the initial, potentially
long-running call to collect the clear-shelf holds to process.
Otherwise, the cstore transaction may time out while waiting on the
holds retrieval to complete.

Signed-off-by: Bill Erickson <berick@esilibrary.com>
Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm

index 40cf63e..e9638f1 100644 (file)
@@ -3473,7 +3473,7 @@ __PACKAGE__->register_method(
 sub clear_shelf_process {
     my($self, $client, $auth, $org_id, $match_copy) = @_;
 
-    my $e = new_editor(authtoken=>$auth, xact => 1);
+    my $e = new_editor(authtoken=>$auth);
     $e->checkauth or return $e->die_event;
     my $cache = OpenSRF::Utils::Cache->new('global');
 
@@ -3486,6 +3486,8 @@ sub clear_shelf_process {
         "open-ils.circ.captured_holds.id_list.expired_on_shelf.retrieve"
     )->run($auth, $org_id, $match_copy);
 
+    $e->xact_begin;
+
     my @holds;
     my @canceled_holds; # newly canceled holds
     my $chunk_size = 25; # chunked status updates