[open-ils-commits] r17995 - trunk/Open-ILS/src/perlmods/OpenILS/Utils (gmc)
svn at svn.open-ils.org
svn at svn.open-ils.org
Sat Sep 25 22:42:52 EDT 2010
Author: gmc
Date: 2010-09-25 22:42:50 -0400 (Sat, 25 Sep 2010)
New Revision: 17995
Modified:
trunk/Open-ILS/src/perlmods/OpenILS/Utils/CStoreEditor.pm
Log:
don't leak cstores if CStoreEditor rollback fails
Patch by Mike Rylander.
Signed-off-by: Galen Charlton <gmc at esilibrary.com>
Modified: trunk/Open-ILS/src/perlmods/OpenILS/Utils/CStoreEditor.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Utils/CStoreEditor.pm 2010-09-25 04:09:57 UTC (rev 17994)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Utils/CStoreEditor.pm 2010-09-26 02:42:50 UTC (rev 17995)
@@ -294,8 +294,17 @@
# -----------------------------------------------------------------------------
sub rollback {
my $self = shift;
- $self->xact_rollback;
- $self->disconnect;
+ my $err;
+ my $ret;
+ try {
+ $self->xact_rollback;
+ } catch Error with {
+ $err = shift
+ } finally {
+ $ret = $self->disconnect
+ };
+ throw $err if ($err);
+ return $ret;
}
sub disconnect {
@@ -334,8 +343,17 @@
# -----------------------------------------------------------------------------
sub finish {
my $self = shift;
- $self->commit;
- $self->reset;
+ my $err;
+ my $ret;
+ try {
+ $self->commit;
+ } catch Error with {
+ $err = shift
+ } finally {
+ $ret = $self->reset
+ };
+ throw $err if ($err);
+ return $ret;
}
More information about the open-ils-commits
mailing list