[open-ils-commits] r18536 - trunk/Open-ILS/src/perlmods/OpenILS/Application/Acq (gmc)

svn at svn.open-ils.org svn at svn.open-ils.org
Thu Oct 28 19:55:23 EDT 2010


Author: gmc
Date: 2010-10-28 19:55:22 -0400 (Thu, 28 Oct 2010)
New Revision: 18536

Modified:
   trunk/Open-ILS/src/perlmods/OpenILS/Application/Acq/EDI.pm
Log:
wrap some EDI message retrievals in transactions

Avoid errors when operating under Slony.

Signed-off-by: Galen Charlton <gmc at esilibrary.com>


Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/Acq/EDI.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/Acq/EDI.pm	2010-10-28 22:43:48 UTC (rev 18535)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/Acq/EDI.pm	2010-10-28 23:55:22 UTC (rev 18536)
@@ -175,8 +175,13 @@
     $e->create_acq_edi_message($incoming);
     $e->xact_commit;
     # refresh: send process_jedi the updated row
-    my $res = __PACKAGE__->process_jedi($e->retrieve_acq_edi_message($incoming->id), $server, $account, $e);
+    $e->xact_begin;
     my $outgoing = $e->retrieve_acq_edi_message($incoming->id);  # refresh again!
+    $e->xact_rollback;
+    my $res = __PACKAGE__->process_jedi($outgoing, $server, $account, $e);
+    $e->xact_begin;
+    $outgoing = $e->retrieve_acq_edi_message($incoming->id);  # refresh again!
+    $e->xact_rollback;
     $outgoing->status($res ? 'processed' : 'proc_error');
     if ($res) {
         $e->xact_begin;
@@ -196,7 +201,9 @@
     ($account and scalar @$message_ids) or return;
     $e ||= new_editor();
 
+    $e->xact_begin;
     my @messageset = map {$e->retrieve_acq_edi_message($_)} @$message_ids;
+    $e->xact_rollback;
     my $m_count = scalar(@messageset);
     (scalar(@$message_ids) == $m_count) or
         $logger->warn(scalar(@$message_ids) - $m_count . " bad IDs passed to send_core (ignored)");



More information about the open-ils-commits mailing list