[open-ils-commits] r18566 - in branches/rel_2_0/Open-ILS: src/perlmods/OpenILS/Application/Acq web/js/ui/default/acq/common (gmc)

svn at svn.open-ils.org svn at svn.open-ils.org
Mon Nov 1 19:24:24 EDT 2010


Author: gmc
Date: 2010-11-01 19:24:23 -0400 (Mon, 01 Nov 2010)
New Revision: 18566

Modified:
   branches/rel_2_0/Open-ILS/src/perlmods/OpenILS/Application/Acq/Lineitem.pm
   branches/rel_2_0/Open-ILS/src/perlmods/OpenILS/Application/Acq/Search.pm
   branches/rel_2_0/Open-ILS/web/js/ui/default/acq/common/li_table.js
Log:
yet another replication race condition fix

Fixes problems that can occur when creating a lineitem
from an existing bib in the catalog; adds an authoritative
version of open-ils.acq.lineitem.retrieve.

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


Modified: branches/rel_2_0/Open-ILS/src/perlmods/OpenILS/Application/Acq/Lineitem.pm
===================================================================
--- branches/rel_2_0/Open-ILS/src/perlmods/OpenILS/Application/Acq/Lineitem.pm	2010-11-01 23:22:53 UTC (rev 18565)
+++ branches/rel_2_0/Open-ILS/src/perlmods/OpenILS/Application/Acq/Lineitem.pm	2010-11-01 23:24:23 UTC (rev 18566)
@@ -67,10 +67,11 @@
 
 
 __PACKAGE__->register_method(
-	method => 'retrieve_lineitem',
-	api_name	=> 'open-ils.acq.lineitem.retrieve',
-	signature => {
-        desc => 'Retrieves a lineitem',
+    method    => 'retrieve_lineitem',
+    api_name  => 'open-ils.acq.lineitem.retrieve',
+    authoritative => 1,
+    signature => {
+        desc   => 'Retrieves a lineitem',
         params => [
             {desc => 'Authentication token',    type => 'string'},
             {desc => 'lineitem ID to retrieve', type => 'number'},

Modified: branches/rel_2_0/Open-ILS/src/perlmods/OpenILS/Application/Acq/Search.pm
===================================================================
--- branches/rel_2_0/Open-ILS/src/perlmods/OpenILS/Application/Acq/Search.pm	2010-11-01 23:22:53 UTC (rev 18565)
+++ branches/rel_2_0/Open-ILS/src/perlmods/OpenILS/Application/Acq/Search.pm	2010-11-01 23:24:23 UTC (rev 18566)
@@ -602,10 +602,12 @@
 
     $logger->info("created @li_ids new lineitems for picklist $picklist");
 
-    # new editor, no transaction needed this time
-    $e = new_editor("authtoken" => $auth) or return $e->die_event;
+    # new editor, but still using transaction to ensure correct retrieval
+    # in a replicated setup
+    $e = new_editor("authtoken" => $auth, xact => 1) or return $e->die_event;
     return $e->die_event unless $e->checkauth;
     $conn->respond($RETRIEVERS{"lineitem"}->($e, $_, $opts)) foreach @li_ids;
+    $e->rollback;
     $e->disconnect;
 
     undef;

Modified: branches/rel_2_0/Open-ILS/web/js/ui/default/acq/common/li_table.js
===================================================================
--- branches/rel_2_0/Open-ILS/web/js/ui/default/acq/common/li_table.js	2010-11-01 23:22:53 UTC (rev 18565)
+++ branches/rel_2_0/Open-ILS/web/js/ui/default/acq/common/li_table.js	2010-11-01 23:24:23 UTC (rev 18566)
@@ -794,7 +794,7 @@
             return handler(li);
         
         fieldmapper.standardRequest(
-            ['open-ils.acq', 'open-ils.acq.lineitem.retrieve'],
+            ['open-ils.acq', 'open-ils.acq.lineitem.retrieve.authoritative'],
             {   async: true,
 
                 params: [self.authtoken, liId, {



More information about the open-ils-commits mailing list