[open-ils-commits] r17994 - trunk/Open-ILS/src/perlmods/OpenILS/Application (erickson)
svn at svn.open-ils.org
svn at svn.open-ils.org
Sat Sep 25 00:10:00 EDT 2010
Author: erickson
Date: 2010-09-25 00:09:57 -0400 (Sat, 25 Sep 2010)
New Revision: 17994
Modified:
trunk/Open-ILS/src/perlmods/OpenILS/Application/AppUtils.pm
Log:
only need to wrap event retrieve in xact for latest copy. otherwise, run the risk of xact-ed cstore timing out
Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/AppUtils.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/AppUtils.pm 2010-09-25 03:54:33 UTC (rev 17993)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/AppUtils.pm 2010-09-25 04:09:57 UTC (rev 17994)
@@ -1627,14 +1627,14 @@
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 @@
# 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 @@
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 @@
}
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;
}
More information about the open-ils-commits
mailing list