Openbravo Issue Tracking System - Modules
View Issue Details
0029131ModulesWarehouse Pickingpublic2015-03-04 16:432015-04-09 11:28
egoitz 
eduardo_Argal 
immediatemajorhave not tried
closedfixed 
5
 
 
dmiguelez
0029131: Bad performance and degradation on the execution on the generate picking list process
The process takes long becuase each generation takes long due to the memory usage.
There is also degradation and the time for each execution of the loop increases.

-Execute the process Generate picking list for a order with 2600 lines.
On the method processOrder from Utilities java class you can replace the
loop
for (OrderLine orderLine : order.getOrderLineList()) {

with

a loop that reads all the id's obtained with a query object:

    final StringBuilder hqlString = new StringBuilder();
    hqlString.append(" select e.id ");
    hqlString.append(" from OrderLine as e");
    hqlString.append(" where e.salesOrder.id = :order");
    Query query = OBDal.getInstance().getSession().createQuery(hqlString.toString());
    
    query.setParameter("order", order.getId());
    
    List<String> stroLines = query.list();
    
    
   
    for ( String strline : stroLines ) {
        OrderLine orderLine = OBDal.getInstance().get(OrderLine.class, strline)


That improves a lot the performance of each execution but does not solve the degradation problem.

Performance
related to defect 0029177 closed eduardo_Argal The sequence for picking list on ad_sequence table is locked while the picking list process is executed 
Issue History
2015-03-04 16:43egoitzNew Issue
2015-03-04 16:43egoitzAssigned To => naiaramartinez
2015-03-04 16:43egoitzResolution time => 1428444000
2015-03-04 16:43egoitzTag Attached: Performance
2015-03-04 16:44egoitzAssigned Tonaiaramartinez => Sandrahuguet
2015-03-04 17:15egoitzNote Added: 0075162
2015-03-04 17:34egoitzResolution time1428444000 => 1425942000
2015-03-04 17:34egoitzPriorityurgent => immediate
2015-03-04 17:56SandrahuguetAssigned ToSandrahuguet => umartirena
2015-03-06 15:36egoitzRelationship addedrelated to 0029177
2015-03-10 11:24hgbotCheckin
2015-03-10 11:24hgbotNote Added: 0075371
2015-03-10 11:24hgbotStatusnew => resolved
2015-03-10 11:24hgbotResolutionopen => fixed
2015-03-10 11:24hgbotFixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.warehouse.pickinglist/rev/e8a78f938850a44a0922ac2d70252ae786d14147 [^]
2015-03-11 10:53hgbotCheckin
2015-03-11 10:53hgbotNote Added: 0075444
2015-03-23 13:41SandrahuguetAssigned Toumartirena => eduardo_Argal
2015-04-09 11:28dmiguelezReview Assigned To => dmiguelez
2015-04-09 11:28dmiguelezNote Added: 0076408
2015-04-09 11:28dmiguelezStatusresolved => closed

Notes
(0075162)
egoitz   
2015-03-04 17:15   
On the utilities class
replacing
 CallStoredProcedure.getInstance().call("M_GET_STOCK_PARAM", params, null, true, true);
with
 CallStoredProcedure.getInstance().call("M_GET_STOCK_PARAM", params, null, false, true);

 improves the performance.
The change removes the flush and i think that can be done because other flushes are done when changes are done.
In any case that improves performance on the first executions but due to the degradation does not solve the problem.
(0075371)
hgbot   
2015-03-10 11:24   
Repository: erp/pmods/org.openbravo.warehouse.pickinglist
Changeset: e8a78f938850a44a0922ac2d70252ae786d14147
Author: Eduardo Argal Guibert <eduardo.argal <at> openbravo.com>
Date: Tue Mar 10 11:24:01 2015 +0100
URL: http://code.openbravo.com/erp/pmods/org.openbravo.warehouse.pickinglist/rev/e8a78f938850a44a0922ac2d70252ae786d14147 [^]

Fixes issue 29131
Bad performance and degradation on the execution on the generate picking list process.
Changed object loop to string loop and chnages ad_sequence retrieval to avoid contention

---
M src/org/openbravo/warehouse/pickinglist/CreateActionHandler.java
M src/org/openbravo/warehouse/pickinglist/Utilities.java
---
(0075444)
hgbot   
2015-03-11 10:53   
Repository: erp/pmods/org.openbravo.warehouse.pickinglist
Changeset: 346fac4a867b907e8f1c12d5b7a163fc8d82447f
Author: David Miguelez <david.miguelez <at> openbravo.com>
Date: Wed Mar 11 15:23:38 2015 +0530
URL: http://code.openbravo.com/erp/pmods/org.openbravo.warehouse.pickinglist/rev/346fac4a867b907e8f1c12d5b7a163fc8d82447f [^]

Related to issue 29131. Fixes wrong success message shown.
It was showing completed PickLists as not completed.

---
M src/org/openbravo/warehouse/pickinglist/Utilities.java
---
(0076408)
dmiguelez   
2015-04-09 11:28   
Code Review + Testing OK