[open-ils-commits] r17997 - in trunk/Open-ILS: src/perlmods/OpenILS/Application web/js/ui/default/circ/selfcheck (gmc)

svn at svn.open-ils.org svn at svn.open-ils.org
Sat Sep 25 22:49:41 EDT 2010


Author: gmc
Date: 2010-09-25 22:49:39 -0400 (Sat, 25 Sep 2010)
New Revision: 17997

Modified:
   trunk/Open-ILS/src/perlmods/OpenILS/Application/Circ.pm
   trunk/Open-ILS/web/js/ui/default/circ/selfcheck/selfcheck.js
Log:
more selfcheck receipt transaction hackery

Instead of having authoritative versions of 
open-ils.circ.fire_*_trigger_events, wrap just the 
target retrieval itself in a transaction.  Avoids as 
yet unexplained rollback failure that occurs if
processing a selfcheck receipt with more than a few items on it.

Signed-off-by: Galen Charlton <gmc at esilibrary.com>


Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/Circ.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/Circ.pm	2010-09-26 02:43:34 UTC (rev 17996)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/Circ.pm	2010-09-26 02:49:39 UTC (rev 17997)
@@ -1456,7 +1456,6 @@
 __PACKAGE__->register_method(
 	method	=> "fire_circ_events", 
 	api_name	=> "open-ils.circ.fire_circ_trigger_events",
-    authoritative => 1,
     signature => q/
         General event def runner for circ objects.  If no event def ID
         is provided, the hook will be used to find the best event_def
@@ -1467,7 +1466,6 @@
 __PACKAGE__->register_method(
 	method	=> "fire_circ_events", 
 	api_name	=> "open-ils.circ.fire_hold_trigger_events",
-    authoritative => 1,
     signature => q/
         General event def runner for hold objects.  If no event def ID
         is provided, the hook will be used to find the best event_def
@@ -1478,7 +1476,6 @@
 __PACKAGE__->register_method(
 	method	=> "fire_circ_events", 
 	api_name	=> "open-ils.circ.fire_user_trigger_events",
-    authoritative => 1,
     signature => q/
         General event def runner for user objects.  If no event def ID
         is provided, the hook will be used to find the best event_def
@@ -1490,7 +1487,7 @@
 sub fire_circ_events {
     my($self, $conn, $auth, $org_id, $event_def, $hook, $granularity, $target_ids, $user_data) = @_;
 
-    my $e = new_editor(authtoken => $auth);
+    my $e = new_editor(authtoken => $auth, xact => 1);
 	return $e->event unless $e->checkauth;
 
     my $targets;
@@ -1505,8 +1502,11 @@
         return $e->event unless $e->allowed('VIEW_CIRCULATIONS', $org_id);
         $targets = $e->batch_retrieve_action_circulation($target_ids);
     }
+    $e->rollback; # FIXME using transaction because of pgpool/slony setups, but not
+                  # simply making this method authoritative because of weirdness
+                  # with transaction handling in A/T code that causes rollback
+                  # failure down the line if handling many targets
 
-    $e->rollback; # paranoia
     return undef unless @$targets;
     return $U->fire_object_event($event_def, $hook, $targets, $org_id, $granularity, $user_data);
 }

Modified: trunk/Open-ILS/web/js/ui/default/circ/selfcheck/selfcheck.js
===================================================================
--- trunk/Open-ILS/web/js/ui/default/circ/selfcheck/selfcheck.js	2010-09-26 02:43:34 UTC (rev 17996)
+++ trunk/Open-ILS/web/js/ui/default/circ/selfcheck/selfcheck.js	2010-09-26 02:49:39 UTC (rev 17997)
@@ -1216,7 +1216,7 @@
 
     var self = this;
     fieldmapper.standardRequest(
-        ['open-ils.circ', 'open-ils.circ.fire_circ_trigger_events.authoritative'],
+        ['open-ils.circ', 'open-ils.circ.fire_circ_trigger_events'],
         {   
             async : true,
             params : params,
@@ -1285,7 +1285,7 @@
 
     var self = this;
     fieldmapper.standardRequest(
-        ['open-ils.circ', 'open-ils.circ.fire_circ_trigger_events.authoritative'],
+        ['open-ils.circ', 'open-ils.circ.fire_circ_trigger_events'],
         {   
             async : true,
             params : params,



More information about the open-ils-commits mailing list