From: miker Date: Sun, 21 Jan 2007 19:03:42 +0000 (+0000) Subject: moving another hold fetch inside a xact block X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=213674db18b90223ae45f0432ff69cc7bff2382d;p=Evergreen.git moving another hold fetch inside a xact block git-svn-id: svn://svn.open-ils.org/ILS/trunk@6796 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/action.pm b/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/action.pm index 0a93498dc3..285fb2e9c4 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/action.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/action.pm @@ -746,10 +746,6 @@ sub new_hold_copy_targeter { for my $hold (@$holds) { try { - #first, re-fetch the hold, to make sure it's not captured already - $hold = action::hold_request->retrieve( $hold->id ); - die "OK\n" if (!$hold or $hold->capture_time); - #start a transaction if needed if ($self->method_lookup('open-ils.storage.transaction.current')->run) { $log->debug("Cleaning up after previous transaction\n"); @@ -758,6 +754,10 @@ sub new_hold_copy_targeter { $self->method_lookup('open-ils.storage.transaction.begin')->run( $client ); $log->info("Processing hold ".$hold->id."...\n"); + #first, re-fetch the hold, to make sure it's not captured already + $hold = action::hold_request->retrieve( $hold->id ); + die "OK\n" if (!$hold or $hold->capture_time); + # remove old auto-targeting maps my @oldmaps = action::hold_copy_map->search( hold => $hold->id ); $_->delete for (@oldmaps);