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

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0033134
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] A. Platformminorhave not tried2016-06-03 17:372018-01-03 12:39
ReportershuehnerView Statuspublic 
Assigned Toinigosanchez 
PriorityhighResolutionfixedFixed in Version3.0PR18Q1
StatusclosedFix in branchFixed in SCM revision64d20a56c50a
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

0033134: ImportEntryProcessor calls initialize() 2 times on OBContext switch causing extra db queries

DescriptionImportEntryProcessor.setOBContext function has following code:

        // initialize several things so that they are not initialized
        // during the processing
        obContext.getEntityAccessChecker().initialize();

However the getEntityAccessChecker() does either return a already initialized objects.

Or it creates a new one and does the initialize() calls itself.

So calling initialize() on the result does calls it 2 times.

That is bad as the init method has 2 db queries which are thus called double.

duration: 0.353 ms execute S_2581/C_2582: select adtab0_.AD_Table_ID as col_0_0_, adwindowac2_.IsReadWrite as col_1_0_ from AD_Tab adtab0_ left outer join AD_Window adwindow1_ on adtab0_.AD_Window_ID=adwindow1_.AD_Window_ID left outer join AD_Window_Access adwindowac2_ on adwindow1_.AD_Window_ID=adwindowac2_.AD_Window_ID where adwindowac2_.AD_Role_ID=$1
duration: 0.010 ms execute S_2583/C_2584: select adtableacc0_.AD_Table_Access_ID as AD1_101_, adtableacc0_.AD_Role_ID as AD2_101_, adtableacc0_.AD_Table_ID as AD3_101_, adtableacc0_.AD_Client_ID as AD4_101_, adtableacc0_.AD_Org_ID as AD5_101_, adtableacc0_.IsActive as IsActive101_, adtableacc0_.Created as Created101_, adtableacc0_.CreatedBy as CreatedBy101_, adtableacc0_.UpdatedBy as UpdatedBy101_, adtableacc0_.Updated as Updated101_, adtableacc0_.IsReadOnly as IsReadOnly101_, adtableacc0_.IsExclude as IsExclude101_, adtableacc0_.Inherited_From as Inherited13_101_ from AD_Table_Access adtableacc0_ where adtableacc0_.AD_Role_ID='29A79A279DC54348B58A2C64891F35AA'

2nd set:
duration: 0.322 ms execute S_2585/C_2586: select adtab0_.AD_Table_ID as col_0_0_, adwindowac2_.IsReadWrite as col_1_0_ from AD_Tab adtab0_ left outer join AD_Window adwindow1_ on adtab0_.AD_Window_ID=adwindow1_.AD_Window_ID left outer join AD_Window_Access adwindowac2_ on adwindow1_.AD_Window_ID=adwindowac2_.AD_Window_ID where adwindowac2_.AD_Role_ID=$1
duration: 0.009 ms execute S_2587/C_2588: select adtableacc0_.AD_Table_Access_ID as AD1_101_, adtableacc0_.AD_Role_ID as AD2_101_, adtableacc0_.AD_Table_ID as AD3_101_, adtableacc0_.AD_Client_ID as AD4_101_, adtableacc0_.AD_Org_ID as AD5_101_, adtableacc0_.IsActive as IsActive101_, adtableacc0_.Created as Created101_, adtableacc0_.CreatedBy as CreatedBy101_, adtableacc0_.UpdatedBy as UpdatedBy101_, adtableacc0_.Updated as Updated101_, adtableacc0_.IsReadOnly as IsReadOnly101_, adtableacc0_.IsExclude as IsExclude101_, adtableacc0_.Inherited_From as Inherited13_101_ from AD_Table_Access adtableacc0_ where adtableacc0_.AD_Role_ID='29A79A279DC54348B58A2C64891F35AA'

Steps To ReproduceIn install containing webpos.
Enable logging of all sql
Trigger OrderLoader (make a ticket)

Trace SQL logged just before OrderLoader starts it functional work.
TagsPerformance
Attached Files

- Relationships Relation Graph ] Dependency Graph ]
related to feature request 0035622 closedinigosanchez Improve performance of the Entity Access Checker process 

-  Notes
(0086997)
shuehner (administrator)
2016-06-03 17:38

Note: removing initialize makes this line of code looks not useful on first glance.

So a code-comment should be added to adjust developer that this line is required and does .initialize() indirectly.
(0100697)
hgbot (developer)
2017-11-24 10:58

Repository: erp/devel/pi
Changeset: 64d20a56c50aef9567da1c1c781654f13fe9946a
Author: Inigo Sanchez <inigo.sanchez <at> openbravo.com>
Date: Fri Nov 24 10:55:40 2017 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/64d20a56c50aef9567da1c1c781654f13fe9946a [^]

Fixed issue 33134: ImportEntryProcessor calls initialize() two times

ImportEntryProcessor was causing extra db queries because it was calling EntityAccessChecker.initialize()
two times. In order to fix the problem, it has been removed one of the calls to initialize method.

---
M src/org/openbravo/service/importprocess/ImportEntryProcessor.java
---
(0100735)
hgbot (developer)
2017-11-27 11:23

Repository: erp/devel/pi
Changeset: a2e1574d92e2f9fd4d1a663d1403b337d7be8d55
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Mon Nov 27 11:22:37 2017 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/a2e1574d92e2f9fd4d1a663d1403b337d7be8d55 [^]

related to bug 33134: made comment clearer

---
M src/org/openbravo/service/importprocess/ImportEntryProcessor.java
---
(0100736)
alostale (manager)
2017-11-27 11:23

reviewed + tested
(0101454)
hudsonbot (developer)
2018-01-03 12:39

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/c81e0d3cbab5 [^]
Maturity status: Test
(0101459)
hudsonbot (developer)
2018-01-03 12:39

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/c81e0d3cbab5 [^]
Maturity status: Test

- Issue History
Date Modified Username Field Change
2016-06-03 17:37 shuehner New Issue
2016-06-03 17:37 shuehner Assigned To => platform
2016-06-03 17:37 shuehner Modules => Core
2016-06-03 17:37 shuehner Triggers an Emergency Pack => No
2016-06-03 17:37 shuehner Tag Attached: Performance
2016-06-03 17:38 shuehner Note Added: 0086997
2016-07-15 09:53 alostale Status new => acknowledged
2016-07-15 09:53 alostale Priority normal => urgent
2016-12-01 13:20 alostale Priority urgent => normal
2016-12-01 14:05 alostale Priority normal => urgent
2016-12-01 14:05 alostale Priority urgent => high
2017-05-29 13:31 shuehner Relationship added related to 0035622
2017-11-23 10:39 inigosanchez Status acknowledged => scheduled
2017-11-23 10:39 inigosanchez Assigned To platform => inigosanchez
2017-11-24 10:50 inigosanchez Review Assigned To => alostale
2017-11-24 10:58 hgbot Checkin
2017-11-24 10:58 hgbot Note Added: 0100697
2017-11-24 10:58 hgbot Status scheduled => resolved
2017-11-24 10:58 hgbot Resolution open => fixed
2017-11-24 10:58 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/64d20a56c50aef9567da1c1c781654f13fe9946a [^]
2017-11-27 11:23 hgbot Checkin
2017-11-27 11:23 hgbot Note Added: 0100735
2017-11-27 11:23 alostale Note Added: 0100736
2017-11-27 11:23 alostale Status resolved => closed
2017-11-27 11:23 alostale Fixed in Version => 3.0PR18Q1
2018-01-03 12:39 hudsonbot Checkin
2018-01-03 12:39 hudsonbot Note Added: 0101454
2018-01-03 12:39 hudsonbot Checkin
2018-01-03 12:39 hudsonbot Note Added: 0101459


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker