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

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0036638
TypeCategorySeverityReproducibilityDate SubmittedLast Update
design defect[Openbravo ERP] A. Platformmajorhave not tried2017-08-10 17:162022-02-01 08:08
ReportershuehnerView Statuspublic 
Assigned ToTriage Platform Base 
PrioritynormalResolutionopenFixed in Version
StatusnewFix in branchFixed in SCM revision
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned To
Web browser
ModulesCore
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0036638: DalConnectionProvider(true) or () in combination with standard xsql causes 1 flush per SQL

DescriptionDalConnectionProvider class i a 'bridge' between the implicit DAL session/connection and code expecting ConnectionProvider interface.

Main consumer of the last are the auto-generated xsql classes/method.

There is a very bad interaction between the two in case of requesting implicit flush of the DalConnectionProvider.

Problem here is that the flush of the DalConnectionProvider is not just done once per instance creation i.e. in new. But instead inside its getConnection() method so every time that method is called.

Problem is now the following usage:
conn = new DalConnectionProvider(true)
SeguridadData.isRoleClient(conn, String, String)
SeguridadData.isUserRole(conn, String, String)

The xsql classes here are just placeholder, topic applies the same way to any which are not marked as 'connection=true'

Problem is that every such method inside called some variant of getPreparedStament which calls getConnection)

So when reusing the same instance of DalConnectionProvider a new flush is run for every xsql-based sql statement.

That is very non-obvious and seems to contradict the intention of that flush which is:
- flush/apply any pending DAL modifications so they are visible on database level
- before calling any SQL manually on database
- which only require single flush I.e. on the 'new'
Steps To Reproduce- Having flush debugging enabled (i.e. stackTrace per flush as discussed in issue 33606)
- click on the UserInfoWidget
- Click 'apply'

That way:
      boolean result = LoginUtils
          .fillSessionArguments(new DalConnectionProvider(), vars, userId,

new ConnectionProvider requesting flush is created.
Passed to the fillSessionArguments function
which isinside reuses that instance for many small selects
Causing total of 36 flushes to be done for this 1 action:
3621931 [http-bio-8080-exec-9] INFO org.openbravo.dal.core.DalRequestFilter - request= /openbravo/org.openbravo.client.kernel?command=save&_action=org.openbravo.client.application.navigationbarcomponents.UserInfoWidgetActionHandler flushCount: 36 flushTime: 179 of total requestTime: 362

TagsPerformance
Attached Filestxt file icon 36638-flushes.txt [^] (203,273 bytes) 2017-08-10 17:18 [Show Content]

- Relationships Relation Graph ] Dependency Graph ]
related to defect 0036636 closedalostale new DalConnectionProvider() causes double flush in 1 case 
related to defect 0037277 closedAtulOpenbravo Change the role in the ERP has performance problems 
related to defect 0037428 newTriage Omni OMS don't use DalConnectionProvider default constructor 
blocks design defect 0036606 newTriage Platform Base Clean up extra not requires flush() calls 

-  Notes
There are no notes attached to this issue.

- Issue History
Date Modified Username Field Change
2017-08-10 17:16 shuehner New Issue
2017-08-10 17:16 shuehner Assigned To => platform
2017-08-10 17:16 shuehner Modules => Core
2017-08-10 17:16 shuehner Triggers an Emergency Pack => No
2017-08-10 17:16 shuehner Relationship added related to 0036636
2017-08-10 17:16 shuehner Relationship added blocks 0036606
2017-08-10 17:18 shuehner File Added: 36638-flushes.txt
2017-10-06 11:54 shuehner Tag Attached: Performance
2017-10-06 11:56 shuehner Severity minor => major
2017-11-30 18:23 shuehner Relationship added related to 0037277
2017-12-01 08:03 alostale Relationship added related to 0037428
2022-02-01 08:08 alostale Assigned To platform => Triage Platform Base


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker