[open-ils-commits] r11478 - trunk/Open-ILS/src/perlmods/OpenILS/Utils
svn at svn.open-ils.org
svn at svn.open-ils.org
Tue Dec 9 14:48:05 EST 2008
Author: erickson
Date: 2008-12-09 14:48:01 -0500 (Tue, 09 Dec 2008)
New Revision: 11478
Modified:
trunk/Open-ILS/src/perlmods/OpenILS/Utils/CStoreEditor.pm
Log:
short-circuit unnecessary rollbacs and commits to prevent erroneous error messages
Modified: trunk/Open-ILS/src/perlmods/OpenILS/Utils/CStoreEditor.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Utils/CStoreEditor.pm 2008-12-09 18:53:41 UTC (rev 11477)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Utils/CStoreEditor.pm 2008-12-09 19:48:01 UTC (rev 11478)
@@ -208,8 +208,9 @@
# -----------------------------------------------------------------------------
sub xact_commit {
my $self = shift;
+ return unless $self->{xact_id};
$self->log(D, "comitting db session");
- my $stat = $self->request($self->app.'.transaction.commit') if $self->{xact_id};
+ my $stat = $self->request($self->app.'.transaction.commit');
$self->log(E, "error comitting database transaction") unless $stat;
delete $self->{xact_id};
return $stat;
@@ -220,9 +221,9 @@
# -----------------------------------------------------------------------------
sub xact_rollback {
my $self = shift;
- return unless $self->{session};
+ return unless $self->{session} and $self->{xact_id};
$self->log(I, "rolling back db session");
- my $stat = $self->request($self->app.".transaction.rollback") if $self->{xact_id};
+ my $stat = $self->request($self->app.".transaction.rollback");
$self->log(E, "error rolling back database transaction") unless $stat;
delete $self->{xact_id};
return $stat;
More information about the open-ils-commits
mailing list