From: Jason Stephenson Date: Sat, 6 Oct 2012 19:33:16 +0000 (-0400) Subject: Fix reproducible "no transaction to rollback" when loading bookbag. X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=4cbc94386a2bb62cc3b8c4edb43bc29876909d82;p=working%2FEvergreen.git Fix reproducible "no transaction to rollback" when loading bookbag. Remove most transaction code from load_myopac_bookbags in OpenILS::WWW:: EGCatLoader::Account, only doing xact_begin when an update is called for. It looks like the original transaction may have been created to prevent the bookbags from changing while being loaded. The comment on the line where the xact_begin call originally was simply said 'replication...' I don't know what problem, if any, that transaction was created to resolve, but dropping most of the transaction code from that method does resolve a reproducible bug. (I also don't know exactly what in the patron's bookbags caused the no transaction to rollback error, but it always appears with the same bookbag with regularity.) 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 91576d4981..48b4112168 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm @@ -1683,11 +1683,9 @@ sub load_myopac_bookbags { $ctx->{bookbags_offset} = $offset; my ($sorter, $modifier) = $self->_get_bookbag_sort_params("sort"); - $e->xact_begin; # replication... my $rv = $self->load_mylist; unless($rv eq Apache2::Const::OK) { - $e->rollback; return $rv; } @@ -1703,7 +1701,6 @@ sub load_myopac_bookbags { ); if(!$ctx->{bookbags}) { - $e->rollback; return Apache2::Const::HTTP_INTERNAL_SERVER_ERROR; } @@ -1728,6 +1725,7 @@ sub load_myopac_bookbags { if ($bookbag) { if ( ($self->cgi->param("action") || '') eq "editmeta") { + $e->xact_begin; if (!$self->_update_bookbag_metadata($bookbag)) { $e->rollback; return Apache2::Const::HTTP_INTERNAL_SERVER_ERROR; @@ -1782,7 +1780,6 @@ sub load_myopac_bookbags { } } - $e->rollback; return Apache2::Const::OK; }