From ff25d47b3cd143b06b63f2ee14ebd79af08e01e3 Mon Sep 17 00:00:00 2001 From: gmc Date: Thu, 28 Oct 2010 23:55:22 +0000 Subject: [PATCH] wrap some EDI message retrievals in transactions Avoid errors when operating under Slony. Signed-off-by: Galen Charlton git-svn-id: svn://svn.open-ils.org/ILS/trunk@18536 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/src/perlmods/OpenILS/Application/Acq/EDI.pm | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Acq/EDI.pm b/Open-ILS/src/perlmods/OpenILS/Application/Acq/EDI.pm index 909944b114..8b90129016 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Acq/EDI.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Acq/EDI.pm @@ -175,8 +175,13 @@ sub process_retrieval { $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 @@ sub send_core { ($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)"); -- 2.11.0