[open-ils-commits] r18036 - in branches/rel_2_0/Open-ILS/src/perlmods/OpenILS/Application: . Circ (erickson)
svn at svn.open-ils.org
svn at svn.open-ils.org
Mon Sep 27 14:34:52 EDT 2010
Author: erickson
Date: 2010-09-27 14:34:48 -0400 (Mon, 27 Sep 2010)
New Revision: 18036
Modified:
branches/rel_2_0/Open-ILS/src/perlmods/OpenILS/Application/AppUtils.pm
branches/rel_2_0/Open-ILS/src/perlmods/OpenILS/Application/Circ/Holds.pm
Log:
backporting some xact management fine tuning
Modified: branches/rel_2_0/Open-ILS/src/perlmods/OpenILS/Application/AppUtils.pm
===================================================================
--- branches/rel_2_0/Open-ILS/src/perlmods/OpenILS/Application/AppUtils.pm 2010-09-27 18:33:41 UTC (rev 18035)
+++ branches/rel_2_0/Open-ILS/src/perlmods/OpenILS/Application/AppUtils.pm 2010-09-27 18:34:48 UTC (rev 18036)
@@ -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;
}
Modified: branches/rel_2_0/Open-ILS/src/perlmods/OpenILS/Application/Circ/Holds.pm
===================================================================
--- branches/rel_2_0/Open-ILS/src/perlmods/OpenILS/Application/Circ/Holds.pm 2010-09-27 18:33:41 UTC (rev 18035)
+++ branches/rel_2_0/Open-ILS/src/perlmods/OpenILS/Application/Circ/Holds.pm 2010-09-27 18:34:48 UTC (rev 18036)
@@ -1279,20 +1279,18 @@
sub print_hold_pull_list {
my($self, $client, $auth, $org_id) = @_;
- my $e = new_editor(authtoken=>$auth, xact=>1);
- return $e->die_event unless $e->checkauth;
+ my $e = new_editor(authtoken=>$auth);
+ return $e->event unless $e->checkauth;
$org_id = (defined $org_id) ? $org_id : $e->requestor->ws_ou;
- return $e->die_event unless $e->allowed('VIEW_HOLD', $org_id);
+ return $e->event unless $e->allowed('VIEW_HOLD', $org_id);
my $hold_ids = $U->storagereq(
'open-ils.storage.direct.action.hold_request.pull_list.id_list.current_copy_circ_lib.status_filtered.atomic',
$org_id, 10000);
- unless (@$hold_ids) {
- $e->rollback;
- return undef;
- }
+ return undef unless @$hold_ids;
+
$client->status(new OpenSRF::DomainObject::oilsContinueStatus);
# Holds will /NOT/ be in order after this ...
@@ -1304,8 +1302,6 @@
my $sorted_holds = [];
push @$sorted_holds, $hold_map->{$_} foreach @$hold_ids;
- $e->rollback;
-
return $U->fire_object_event(
undef, "ahr.format.pull_list", $sorted_holds,
$org_id, undef, undef, $client
More information about the open-ils-commits
mailing list