[open-ils-commits] r17996 - branches/rel_2_0/Open-ILS/src/perlmods/OpenILS/Utils (gmc)
svn at svn.open-ils.org
svn at svn.open-ils.org
Sat Sep 25 22:43:36 EDT 2010
Author: gmc
Date: 2010-09-25 22:43:34 -0400 (Sat, 25 Sep 2010)
New Revision: 17996
Modified:
branches/rel_2_0/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: branches/rel_2_0/Open-ILS/src/perlmods/OpenILS/Utils/CStoreEditor.pm
===================================================================
--- branches/rel_2_0/Open-ILS/src/perlmods/OpenILS/Utils/CStoreEditor.pm 2010-09-26 02:42:50 UTC (rev 17995)
+++ branches/rel_2_0/Open-ILS/src/perlmods/OpenILS/Utils/CStoreEditor.pm 2010-09-26 02:43:34 UTC (rev 17996)
@@ -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