Anonymous | Login
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] 02. Master data managementmajoralways2015-04-27 16:272015-06-06 16:53
ReporteregoitzView Statuspublic 
Assigned Toumartirena 
PriorityimmediateResolutionfixedFixed in Version
StatusclosedFix in branchFixed in SCM revision654d4ad1872f
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned Todmiguelez
Web browser
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo

0029708: The costing background process is very slow

DescriptionExecuting the costing background process on an environment with more than 1.500.000 transactions to be processed takes long
Steps To Reproduce-Execute the process on an environment with more than 1.500.000 transactions where the process has never been executed before.

*Right now the commmit is being done for every iteration of the loop.
Doing the commit for every x iterations reduces the time.

TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]
related to defect 0029739 closedTriage Finance Costing Background process takes most of the time of execution on a system 
causes defect 0030201 closeddmiguelez Costing Background Process does not process Transactions if there are more than 1000 in Skip Status 

-  Notes
hgbot (developer)
2015-06-04 17:47

Repository: erp/devel/pi
Changeset: 654d4ad1872f1468265ac30de77d055fcd63abde
Author: Unai Martirena <unai.martirena <at>>
Date: Tue Jun 02 09:12:55 2015 +0200
URL: [^]

Fixes bug 29708, Fixes bug 29936: Improve performance and memory problems

2 Problems are happening in Costing Background process:

1) Java Heap error: This problem happens because getTransactions method can load on memory a lot of objects and even an ScrollableResult is being used the following sentence 'OBDal.getInstance().getConnection().setHoldability(ResultSet.HOLD_CURSORS_OVER_COMMIT)' prevents in fact to scroll properly the ScrollableResult. To avoid this issue the query of getTransactions method has been changed to return only 1000 records. So, instead of calling just once this method it is done once each 1000 records.

Also instead of returning a list of 1000 MaterialTransaction objects, that can be a relatively big amount of objects to load in memory, only the Ids are returned and each id the it is instanced on each iteration.

2) Performance problems: The process has a performance issue because it does a commit on each iteration of the list. Now, this has been changed to do commit every 1000 records, and in case that an exception is raised on a certain iteration a new method has been added in catch clause to calculate the cost of the transactions that have been rolledback but which there were properly calculated.

M src/org/openbravo/costing/
dmiguelez (developer)
2015-06-04 18:04

Code Review + Testing Ok
hudsonbot (developer)
2015-06-06 16:53

A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: [^]
Maturity status: Test

- Issue History
Date Modified Username Field Change
2015-04-27 16:27 egoitz New Issue
2015-04-27 16:27 egoitz Assigned To => Triage Finance
2015-04-27 16:27 egoitz Modules => Core
2015-04-27 16:27 egoitz Triggers an Emergency Pack => No
2015-04-29 19:45 VictorVillar Issue Monitored: VictorVillar
2015-04-30 13:25 ioritzCia Relationship added has duplicate 0029739
2015-04-30 13:26 egoitz Priority urgent => immediate
2015-04-30 13:30 ioritzCia Relationship deleted has duplicate 0029739
2015-04-30 13:30 ioritzCia Relationship added related to 0029739
2015-06-03 17:30 umartirena Assigned To Triage Finance => umartirena
2015-06-03 17:30 umartirena Status new => scheduled
2015-06-04 17:47 hgbot Checkin
2015-06-04 17:47 hgbot Note Added: 0078093
2015-06-04 17:47 hgbot Status scheduled => resolved
2015-06-04 17:47 hgbot Resolution open => fixed
2015-06-04 17:47 hgbot Fixed in SCM revision => [^]
2015-06-04 18:04 dmiguelez Review Assigned To => dmiguelez
2015-06-04 18:04 dmiguelez Note Added: 0078096
2015-06-04 18:04 dmiguelez Status resolved => closed
2015-06-06 16:53 hudsonbot Checkin
2015-06-06 16:53 hudsonbot Note Added: 0078127
2015-06-18 10:11 dmitry_mezentsev Relationship added causes 0030201

Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker