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 <berick@esilibrary.com>
# 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,
}
}
]);
+ $e->rollback;
if($copy->call_number->id == -1) {
return {
title => $copy->dummy_title,