LP1550035 Address deletion / avoid xact collisions
authorBill Erickson <berickxx@gmail.com>
Sun, 6 Mar 2016 23:09:30 +0000 (18:09 -0500)
committerGalen Charlton <gmc@esilibrary.com>
Mon, 14 Mar 2016 21:54:43 +0000 (17:54 -0400)
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>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Open-ILS/src/perlmods/lib/OpenILS/Application/Actor.pm

index 56205f2..87fb870 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);
 }