You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by jl...@apache.org on 2014/10/30 19:03:44 UTC

svn commit: r1635567 - /ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java

Author: jleroux
Date: Thu Oct 30 18:03:43 2014
New Revision: 1635567

URL: http://svn.apache.org/r1635567
Log:
Commit for https://issues.apache.org/jira/browse/OFBIZ-5843

Re-running the same load test with a service call proves that the problem was not in the service call but only in the minilang implementation. So putting back this part.

There are more work to do as suggested Scott on dev ML: the call could be done in the same transaction right before committing, to reduce the amount of time the lock is held. But for now it's enough

Modified:
    ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java

Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java?rev=1635567&r1=1635566&r2=1635567&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java (original)
+++ ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java Thu Oct 30 18:03:43 2014
@@ -281,10 +281,15 @@ public class OrderServices {
                     normalizedItemQuantities.put(currentProductId, currentQuantity.add(orderItem.getBigDecimal("quantity")));
                 }
 
-                Map<String, Object> countContext = new HashMap<String, Object>();
-                countContext.put("productId", currentProductId);
-                countContext.put("quantity", orderItem.getBigDecimal("quantity"));
-                countProductQuantityOrdered(ctx, countContext);
+                try {
+                    // count product ordered quantities
+                    // run this synchronously so it will run in the same transaction
+                    dispatcher.runSync("countProductQuantityOrdered", UtilMisc.<String, Object>toMap("productId", currentProductId, "quantity", orderItem.getBigDecimal("quantity"), "userLogin", userLogin));
+                } catch (GenericServiceException e1) {
+                    Debug.logError(e1, "Error calling countProductQuantityOrdered service", module);
+                    return ServiceUtil.returnError(UtilProperties.getMessage(resource_error,
+                            "OrderErrorCallingCountProductQuantityOrderedService",locale) + e1.toString());
+                }
             }
         }