Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0029118Openbravo ERP04. Warehouse managementpublic2015-03-03 18:302015-05-07 22:16
umartirena 
umartirena 
highmajoralways
closedfixed 
5
 
3.0PR15Q3 
Sandrahuguet
Core
No
0029118: Performance Problems on Costing Background process
Running Costing Background process on an environment with a lot of transactions to be calculated (200.000), it consumes a lot of memory and cpu, and it does not finish.
We have an environment with a lot of transactions in which the problem is reproduced.

Launch Costing Background process.
Approved, Performance
depends on backport 00291883.0PR15Q1.3 closed umartirena Performance Problems on Costing Background process 
depends on backport 00294873.0PR15Q2 closed umartirena Performance Problems on Costing Background process 
Issue History
2015-03-03 18:30umartirenaNew Issue
2015-03-03 18:30umartirenaAssigned To => Sandrahuguet
2015-03-03 18:30umartirenaModules => Core
2015-03-03 18:30umartirenaTriggers an Emergency Pack => No
2015-03-03 18:30umartirenaTag Attached: Performance
2015-03-03 18:31umartirenaAssigned ToSandrahuguet => umartirena
2015-03-04 10:08egoitzResolution time => 1427839200
2015-03-09 09:21umartirenaStatusnew => scheduled
2015-03-09 20:02dmitry_mezentsevTag Attached: Approved
2015-04-01 09:43SandrahuguetStatusscheduled => acknowledged
2015-04-01 09:43SandrahuguetStatusacknowledged => scheduled
2015-04-01 10:48hgbotCheckin
2015-04-01 10:48hgbotNote Added: 0076290
2015-04-01 10:48hgbotStatusscheduled => resolved
2015-04-01 10:48hgbotResolutionopen => fixed
2015-04-01 10:48hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/115dc304149663ee5e27d18077840054823b35ca [^]
2015-04-01 10:49SandrahuguetReview Assigned To => Sandrahuguet
2015-04-01 10:49SandrahuguetNote Added: 0076293
2015-04-01 10:49SandrahuguetStatusresolved => closed
2015-04-01 10:49SandrahuguetFixed in Version => 3.0PR15Q3
2015-05-07 22:16hudsonbotCheckin
2015-05-07 22:16hudsonbotNote Added: 0077107

Notes
(0076290)
hgbot   
2015-04-01 10:48   
Repository: erp/devel/pi
Changeset: 115dc304149663ee5e27d18077840054823b35ca
Author: Unai Martirena <unai.martirena <at> openbravo.com>
Date: Wed Mar 04 16:09:33 2015 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/115dc304149663ee5e27d18077840054823b35ca [^]

Fixes bug 29118: Performance improved in Costing Background process.

There are two methods in Costing Background process in which an ScrollableResult is built and iterated. 'setCalculatedTransactionsAsProcessed' and 'setCalculatedTransactionsAsProcessed'. This loops where causing Out of memory issues because they were not flushing and clearing session every little amount of iterations. Apart from this, the two ScrollableResults were leaving opened, which may cause lot of issues especially in Oracle.

Finally, these methods have been implemented in another way. Directly updating all the records on a single update in hql. In this way the performance is improved even adding flush and clear on the previously loops.

---
M src/org/openbravo/costing/CostingBackground.java
---
(0076293)
Sandrahuguet   
2015-04-01 10:49   
Code review + testing OK
(0077107)
hudsonbot   
2015-05-07 22:16   
A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/a1817f84bd8b [^]
Maturity status: Test