JBAS-2094 Transit update occurs in main transaction
authorBill Erickson <berickxx@gmail.com>
Mon, 27 Aug 2018 19:17:30 +0000 (15:17 -0400)
committerBill Erickson <berickxx@gmail.com>
Thu, 21 Mar 2019 19:46:23 +0000 (15:46 -0400)
Avoid creating a secondary transaction when updating transits to use a
new source lib/time.  Update should occur in the in-progress transaction
instead.

Signed-off-by: Bill Erickson <berickxx@gmail.com>
Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm

index 463382a..2a7c16c 100644 (file)
@@ -3514,14 +3514,15 @@ sub process_received_transit {
         my $loc = $self->circ_lib;
         my $dest = $transit->dest;
 
-       # If item needs to be routed to a different location, update the source & send time
-        my $e = $self->editor;
-        $e->xact_begin;
+        # KCLS
+        # If item needs to be routed to a different location, update the 
+        # source org unit & send time
+        # NOTE: transits have a prev_hop field meant to serve this purpose.
+        # Investigate possibility of using that instead to retain data.
         $transit->source($self->circ_lib);
         $transit->source_send_time('now');
         $self->bail_on_events($self->editor->event)
-            unless $e->update_action_transit_copy($transit);
-        $e->xact_commit;
+            unless $self->editor->update_action_transit_copy($transit);
 
         $logger->info("circulator: Fowarding transit on copy which is destined ".
             "for a different location. transit=$tid, copy=$copyid, current ".