From: erickson Date: Wed, 22 Apr 2009 17:07:50 +0000 (+0000) Subject: prevent erroneous error message on xact begin when an exact already exists X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=6a70b8b1b2384b4a5810a3ce9a683981dc4423d6;p=evergreen%2Fmasslnc.git prevent erroneous error message on xact begin when an exact already exists git-svn-id: svn://svn.open-ils.org/ILS/trunk@12964 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/src/perlmods/OpenILS/Utils/CStoreEditor.pm b/Open-ILS/src/perlmods/OpenILS/Utils/CStoreEditor.pm index c4b7f34bc5..43a925a483 100644 --- a/Open-ILS/src/perlmods/OpenILS/Utils/CStoreEditor.pm +++ b/Open-ILS/src/perlmods/OpenILS/Utils/CStoreEditor.pm @@ -210,11 +210,13 @@ sub xact_begin { return $self->{xact_id} if $self->{xact_id}; $self->session->connect unless $self->session->state == OpenSRF::AppSession::CONNECTED(); $self->log(D, "starting new database transaction"); - my $stat = $self->request($self->app . '.transaction.begin') unless $self->{xact_id}; - $self->log(E, "error starting database transaction") unless $stat; - $self->{xact_id} = $stat; + unless($self->{xact_id}) { + my $stat = $self->request($self->app . '.transaction.begin'); + $self->log(E, "error starting database transaction") unless $stat; + $self->{xact_id} = $stat; + } $self->{xact} = 1; - return $stat; + return $self->{xact_id}; } # -----------------------------------------------------------------------------