LP1550035 Address deletion / avoid xact collisions user/berick/lp-1553813-patron-reg-validation-perms
authorBill Erickson <berickxx@gmail.com>
Sun, 6 Mar 2016 23:09:30 +0000 (18:09 -0500)
committerBill Erickson <berickxx@gmail.com>
Sun, 6 Mar 2016 23:09:34 +0000 (18:09 -0500)
Avoid transaction collision errors when updating patrons, in cases where
the patron object has to be updated more than once, by refreshing the
last_xact_id value on the in-progress patron object.

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

index 07e5d6d..32a16df 100644 (file)
@@ -667,6 +667,10 @@ sub _update_patron {
 
     $e->update_actor_user($patron) or return (undef, $e->die_event);
 
+    # re-fetch the user to pick up the latest last_xact_id value
+    # to avoid collisions.
+    $patron = $e->retrieve_actor_user($patron->id);
+
     return ($patron);
 }