From: Bill Erickson Date: Thu, 18 Oct 2012 18:54:08 +0000 (-0400) Subject: Rollback cstore transaction before bbag record load X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=5cf254fb3e63fb3e700cbfc743fcf5270c8e4d0c;p=working%2FEvergreen.git Rollback cstore transaction before bbag record load To avoid timeouts, which results in transaction rollbacks, preemptively roll back the bookbag fetching cstore transaction before we retrieve what could be a very large list of bookbag records data. Conflicts: Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm Signed-off-by: Bill Erickson Signed-off-by: Jason Stephenson --- diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm index 285c5f6d63..a35fef6b64 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm @@ -1670,6 +1670,11 @@ sub load_myopac_bookbags { } } + # we're done with our CStoreEditor. Rollback here so + # later calls don't cause a timeout, resulting in a + # transaction rollback under the covers. + $e->rollback; + my $query = $self->_prepare_bookbag_container_query( $bookbag->id, $sorter, $modifier ); @@ -1684,6 +1689,7 @@ sub load_myopac_bookbags { my $items = $U->bib_container_items_via_search($bookbag->id, $query, $args) or return Apache2::Const::HTTP_INTERNAL_SERVER_ERROR; + my (undef, @recs) = $self->get_records_and_facets( [ map {$_->target_biblio_record_entry->id} @$items ], undef, @@ -1696,7 +1702,10 @@ sub load_myopac_bookbags { } } + # this rollback may be a dupe, but that's OK because + # cstoreditor ignores dupe rollbacks $e->rollback; + return Apache2::Const::OK; }