Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0033186
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] A. Platformminorhave not tried2016-06-07 20:372016-06-10 12:00
ReportershuehnerView Statuspublic 
Assigned Toshuehner 
PrioritynormalResolutionfixedFixed in Version3.0PR16Q3
StatusclosedFix in branchFixed in SCM revision1f8eba41e1f1
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned Toalostale
Web browser
ModulesCore
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0033186: OBContext.setReadableOrganizations loads tons of Organization objects into DAL session

DescriptionTriggered via.
OrderLoader -> initializeVariables -> Preferences.getPreferenceValue -> OBQuery.addOrgClientActiveFilter -> obContext.getReadableOrganizations() -> setReadableOrganizations.

Issue is essentially
getOrganizationList
getOrganizations

both query database and return list of DAL Organization objects which are thus loaded into current DAL session and kept until next .clear()

However reviewing example users of those lists
setReadableOrganizations

shows that those DAL objects are not really needed as full objects but simple String of id is enough.

Prototyping to replace the 2 functions to return 'o.id' in HQL query shows directly a drop of number of Organizations in DAL session from >=300 down to 1

Note: Patch is proof of concept only but shows the improvement in number of dal objects in session in the single tested flow. Patch has both proof of concept + debugging code to debug-print number of objects in session
Steps To Reproduce-
TagsPerformance
Attached Filesdiff file icon 33186.diff [^] (4,699 bytes) 2016-06-07 20:37 [Show Content]
diff file icon 33186_v2.diff [^] (4,465 bytes) 2016-06-08 23:10 [Show Content]

- Relationships Relation Graph ] Dependency Graph ]
related to defect 0033187 closedshuehner OrganizationStructureProvider loads many ADTreeNode DAL objects into memory which could be avoided. 

-  Notes
(0087102)
shuehner (administrator)
2016-06-08 23:10

Attached cleanup version of the prototype patch without lots of testing + debugging code
(0087148)
hgbot (developer)
2016-06-10 11:55

Repository: erp/devel/pi
Changeset: 1f8eba41e1f1f21e38311d4ac934f2890e8e0ee5
Author: Stefan Hühner <stefan.huehner <at> openbravo.com>
Date: Fri Jun 10 11:53:53 2016 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/1f8eba41e1f1f21e38311d4ac934f2890e8e0ee5 [^]

fixed 33186: OBContext.setReadableOrganizations loads Org objects in session

  OBContext.setReadableOrganizations, invoked on session creation, loaded full
  DAL Organization objects in session. This caused slowness while loading and
  in subsequent DAL flushes.

  Now instead of loading full DAL objects, only ids are fetched from DB, in this
  manner initialization is faster and flushes don't get affected.

---
M src/org/openbravo/dal/core/OBContext.java
---
(0087150)
alostale (manager)
2016-06-10 12:00

code reviewed

tested:
- now when those organization objects are not seen anymore when flushing in order loader

- Issue History
Date Modified Username Field Change
2016-06-07 20:37 shuehner New Issue
2016-06-07 20:37 shuehner Assigned To => platform
2016-06-07 20:37 shuehner Modules => Core
2016-06-07 20:37 shuehner Triggers an Emergency Pack => No
2016-06-07 20:37 shuehner Tag Attached: Performance
2016-06-07 20:37 shuehner File Added: 33186.diff
2016-06-07 21:14 shuehner Relationship added related to 0033187
2016-06-08 23:10 shuehner File Added: 33186_v2.diff
2016-06-08 23:10 shuehner Note Added: 0087102
2016-06-10 11:46 alostale Assigned To platform => shuehner
2016-06-10 11:46 alostale Review Assigned To => alostale
2016-06-10 11:55 hgbot Checkin
2016-06-10 11:55 hgbot Note Added: 0087148
2016-06-10 11:55 hgbot Status new => resolved
2016-06-10 11:55 hgbot Resolution open => fixed
2016-06-10 11:55 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/1f8eba41e1f1f21e38311d4ac934f2890e8e0ee5 [^]
2016-06-10 12:00 alostale Note Added: 0087150
2016-06-10 12:00 alostale Status resolved => closed
2016-06-10 12:00 alostale Fixed in Version => 3.0PR16Q3


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker