[open-ils-commits] r18786 - branches/rel_2_0/Open-ILS/web/js/dojo/openils/PermaCrud (gmc)

svn at svn.open-ils.org svn at svn.open-ils.org
Thu Nov 18 11:31:37 EST 2010


Author: gmc
Date: 2010-11-18 11:31:34 -0500 (Thu, 18 Nov 2010)
New Revision: 18786

Modified:
   branches/rel_2_0/Open-ILS/web/js/dojo/openils/PermaCrud/Store.js
Log:
fetchItemByIdentity now returns null immediately upon null identity

Besides being trivially more efficient, this avoids a situation
where pcrud can sometimes time out when attempting to retrieve
a row by a null PK value.

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

Modified: branches/rel_2_0/Open-ILS/web/js/dojo/openils/PermaCrud/Store.js
===================================================================
--- branches/rel_2_0/Open-ILS/web/js/dojo/openils/PermaCrud/Store.js	2010-11-18 16:28:21 UTC (rev 18785)
+++ branches/rel_2_0/Open-ILS/web/js/dojo/openils/PermaCrud/Store.js	2010-11-18 16:31:34 UTC (rev 18786)
@@ -613,6 +613,11 @@
             //      the *onItem* callback from the *keywordArgs* object.  If we
             //      tried to retrieve the item with pcrud but didn't get an item
             //      back, issue the *onError* callback.
+           if (keywordArgs.identity == undefined)
+                return null; // Identity API spec unclear whether error callback
+                             // would need to be run, so we won't.  Matters
+                             // because in some cases pcrud times out when attempting
+                             // to retrieve by a null PK value
             var callback_scope = keywordArgs.scope || dojo.global;
             var test_item = this._stored_items[keywordArgs.identity];
 



More information about the open-ils-commits mailing list