[open-ils-commits] r11479 - branches/rel_1_4/Open-ILS/src/perlmods/OpenILS/Utils
svn at svn.open-ils.org
svn at svn.open-ils.org
Tue Dec 9 14:48:52 EST 2008
Author: erickson
Date: 2008-12-09 14:48:48 -0500 (Tue, 09 Dec 2008)
New Revision: 11479
Modified:
branches/rel_1_4/Open-ILS/src/perlmods/OpenILS/Utils/CStoreEditor.pm
Log:
short-circuit unnecessary rollbacs and commits to prevent erroneous error messages
Modified: branches/rel_1_4/Open-ILS/src/perlmods/OpenILS/Utils/CStoreEditor.pm
===================================================================
--- branches/rel_1_4/Open-ILS/src/perlmods/OpenILS/Utils/CStoreEditor.pm 2008-12-09 19:48:01 UTC (rev 11478)
+++ branches/rel_1_4/Open-ILS/src/perlmods/OpenILS/Utils/CStoreEditor.pm 2008-12-09 19:48:48 UTC (rev 11479)
@@ -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