From 20ef8092ebeb33f57b59fe55743732cb2be48a70 Mon Sep 17 00:00:00 2001 From: erickson Date: Sat, 25 Sep 2010 04:09:57 +0000 Subject: [PATCH] only need to wrap event retrieve in xact for latest copy. otherwise, run the risk of xact-ed cstore timing out git-svn-id: svn://svn.open-ils.org/ILS/trunk@17994 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/src/perlmods/OpenILS/Application/AppUtils.pm | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Open-ILS/src/perlmods/OpenILS/Application/AppUtils.pm b/Open-ILS/src/perlmods/OpenILS/Application/AppUtils.pm index a91a714763..74f270f5e2 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/AppUtils.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/AppUtils.pm @@ -1627,14 +1627,14 @@ sub find_event_def_by_hook { sub fire_object_event { my($self, $event_def, $hook, $object, $context_org, $granularity, $user_data, $client) = @_; - my $e = OpenILS::Utils::CStoreEditor->new(xact => 1); + my $e = OpenILS::Utils::CStoreEditor->new; my $def; my $auto_method = "open-ils.trigger.event.autocreate.by_definition"; if($event_def) { $def = $e->retrieve_action_trigger_event_definition($event_def) - or return $e->die_event; + or return $e->event; $auto_method .= '.include_inactive'; @@ -1642,7 +1642,7 @@ sub fire_object_event { # find the most appropriate event def depending on context org $def = $self->find_event_def_by_hook($hook, $context_org, $e) - or return $e->die_event; + or return $e->event; } my $final_resp; @@ -1679,10 +1679,12 @@ sub fire_object_event { if($resp and $resp->{events} and @{$resp->{events}}) { + $e->xact_begin; $final_resp = $e->retrieve_action_trigger_event([ $resp->{events}->[0]->id, {flesh => 1, flesh_fields => {atev => ['template_output', 'error_output']}} ]); + $e->rollback; } } else { @@ -1719,14 +1721,15 @@ sub fire_object_event { } if($resp and $resp->{event}) { + $e->xact_begin; $final_resp = $e->retrieve_action_trigger_event([ $resp->{event}->id, {flesh => 1, flesh_fields => {atev => ['template_output', 'error_output']}} ]); + $e->rollback; } } - $e->rollback; return $final_resp; } -- 2.11.0