From 182971190323a88b3887299e6510f989cb3ab121 Mon Sep 17 00:00:00 2001 From: gmc Date: Sun, 26 Sep 2010 02:49:39 +0000 Subject: [PATCH] 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 git-svn-id: svn://svn.open-ils.org/ILS/trunk@17997 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/src/perlmods/OpenILS/Application/Circ.pm | 10 +++++----- Open-ILS/web/js/ui/default/circ/selfcheck/selfcheck.js | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Circ.pm b/Open-ILS/src/perlmods/OpenILS/Application/Circ.pm index 57b4cb8ced..89a06fa31c 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Circ.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Circ.pm @@ -1456,7 +1456,6 @@ sub test_batch_circ_events { __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( __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( __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 @@ __PACKAGE__->register_method( 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 @@ sub fire_circ_events { 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); } diff --git a/Open-ILS/web/js/ui/default/circ/selfcheck/selfcheck.js b/Open-ILS/web/js/ui/default/circ/selfcheck/selfcheck.js index a10ad0abca..4ef30e5c7d 100644 --- a/Open-ILS/web/js/ui/default/circ/selfcheck/selfcheck.js +++ b/Open-ILS/web/js/ui/default/circ/selfcheck/selfcheck.js @@ -1216,7 +1216,7 @@ SelfCheckManager.prototype.printSessionReceipt = function(callback) { 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 @@ SelfCheckManager.prototype.printItemsOutReceipt = function(callback) { 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, -- 2.43.2