From: Bill Erickson Date: Wed, 5 Dec 2012 18:52:01 +0000 (-0500) Subject: Repair cstore transaction leak in A/T reactor helper X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=c577356c7a59c47d32aba45790c9efd2dc223f73;p=evergreen%2Fequinox.git 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 --- 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 d53a52dad2..0966bfd72a 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Trigger/Reactor.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Trigger/Reactor.pm @@ -107,7 +107,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, @@ -117,6 +118,7 @@ $_TT_helpers = { } } ]); + $e->rollback; if($copy->call_number->id == -1) { return { title => $copy->dummy_title,