From: gmc <gmc@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Date: Wed, 20 Oct 2010 21:47:34 +0000 (+0000)
Subject: use a transaction when searching for the nearest hold request
X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=b93e4419c7013e3ed21f36d0665de9bd8f92a428;p=evergreen%2Fmasslnc.git

use a transaction when searching for the nearest hold request

Solves the following problem in a setup that uses Slony - if
multiple items that can fulfill the same hold are checked
in one after another, occassionally two items will end up
being put in transit for the same hold request.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>


git-svn-id: svn://svn.open-ils.org/ILS/trunk@18432 dcc99617-32d9-48b4-a31d-7c20da2025e4
---

diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Circ/Holds.pm b/Open-ILS/src/perlmods/OpenILS/Application/Circ/Holds.pm
index 020999a332..95cb8c8a16 100644
--- a/Open-ILS/src/perlmods/OpenILS/Application/Circ/Holds.pm
+++ b/Open-ILS/src/perlmods/OpenILS/Application/Circ/Holds.pm
@@ -2457,7 +2457,7 @@ sub find_nearest_permitted_hold {
 	my $fifo = $U->ou_ancestor_setting_value($user->ws_ou, 'circ.holds_fifo');
 
 	# search for what should be the best holds for this copy to fulfill
-	my $best_holds = $U->storagereq(
+	my $best_holds = $U->storagereq_xact(
         "open-ils.storage.action.hold_request.nearest_hold.atomic", 
 		$user->ws_ou, $copy->id, 10, $hold_stall_interval, $fifo );