Author: doogie
Date: Wed May 26 14:22:08 2010
New Revision: 948438
URL:
http://svn.apache.org/viewvc?rev=948438&view=revLog:
When use-iterator=true, then no caching is possible. So, if caching was
requested during an inventory lookup, then turn off the use of the
iterator, so that the cache can actually be used. This is a speedup.
Modified:
ofbiz/trunk/applications/product/script/org/ofbiz/product/inventory/InventoryServices.xml
Modified: ofbiz/trunk/applications/product/script/org/ofbiz/product/inventory/InventoryServices.xml
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/script/org/ofbiz/product/inventory/InventoryServices.xml?rev=948438&r1=948437&r2=948438&view=diff==============================================================================
--- ofbiz/trunk/applications/product/script/org/ofbiz/product/inventory/InventoryServices.xml (original)
+++ ofbiz/trunk/applications/product/script/org/ofbiz/product/inventory/InventoryServices.xml Wed May 26 14:22:08 2010
@@ -604,7 +604,13 @@ under the License.
<set from-field="parameters.locationSeqId" field="lookupFieldMap.locationSeqId"/>
<set from-field="parameters.containerId" field="lookupFieldMap.containerId"/>
<!-- we might get away with a cache here since real serious errors will occur during the reservation service... but only if we need the speed -->
- <find-by-and entity-name="InventoryItem" map="lookupFieldMap" list="inventoryItems" use-iterator="true" use-cache="${parameters.useCache}"/>
+ <if-compare field="parameters.useCache" operator="equals" value="true" type="Boolean">
+ <!-- if caching was requested, don't use an iterator -->
+ <find-by-and entity-name="InventoryItem" map="lookupFieldMap" list="inventoryItems" use-cache="true"/>
+ <else>
+ <find-by-and entity-name="InventoryItem" map="lookupFieldMap" list="inventoryItems" use-iterator="true" use-cache="false"/>
+ </else>
+ </if-compare>
<set field="parameters.availableToPromiseTotal" value="0" type="BigDecimal"/>
<set field="parameters.quantityOnHandTotal" value="0" type="BigDecimal"/>