From 189697dfde9cf8653611e5ed51919af0a92ac3ed Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Wed, 5 Dec 2012 13:52:01 -0500 Subject: [PATCH] Repair cstore transaction leak in A/T reactor helper This is not good: my $copy = new_editor(xact=>1)->retrieve_asset_copy(...) This opens a connection to a cstore drone and creates a transaction without closing the transaction or connection, causing the cstore drone to be idle and un-usable for the duration of the keepalive timeout. Signed-off-by: Bill Erickson --- Open-ILS/src/perlmods/lib/OpenILS/Application/Trigger/Reactor.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Trigger/Reactor.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Trigger/Reactor.pm index 62ca21b7d0..b262589713 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Trigger/Reactor.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Trigger/Reactor.pm @@ -101,7 +101,8 @@ $_TT_helpers = { # given a copy, returns the title and author in a hash get_copy_bib_basics => sub { my $copy_id = shift; - my $copy = new_editor(xact=>1)->retrieve_asset_copy([ + my $e = new_editor(xact => 1); + my $copy = $e->retrieve_asset_copy([ $copy_id, { flesh => 2, @@ -111,6 +112,7 @@ $_TT_helpers = { } } ]); + $e->rollback; if($copy->call_number->id == -1) { return { title => $copy->dummy_title, -- 2.11.0