Openbravo Issue Tracking System - Openbravo ERP | |||||||||||||||||||||||||||||||||
View Issue Details | |||||||||||||||||||||||||||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | ||||||||||||||||||||||||||||
0036638 | Openbravo ERP | A. Platform | public | 2017-08-10 17:16 | 2022-02-01 08:08 | ||||||||||||||||||||||||||||
Reporter | shuehner | ||||||||||||||||||||||||||||||||
Assigned To | Triage Platform Base | ||||||||||||||||||||||||||||||||
Priority | normal | Severity | major | Reproducibility | have not tried | ||||||||||||||||||||||||||||
Status | new | Resolution | open | ||||||||||||||||||||||||||||||
Platform | OS | 5 | OS Version | ||||||||||||||||||||||||||||||
Product Version | |||||||||||||||||||||||||||||||||
Target Version | Fixed in Version | ||||||||||||||||||||||||||||||||
Merge Request Status | |||||||||||||||||||||||||||||||||
Review Assigned To | |||||||||||||||||||||||||||||||||
OBNetwork customer | |||||||||||||||||||||||||||||||||
Web browser | |||||||||||||||||||||||||||||||||
Modules | Core | ||||||||||||||||||||||||||||||||
Support ticket | |||||||||||||||||||||||||||||||||
Regression level | |||||||||||||||||||||||||||||||||
Regression date | |||||||||||||||||||||||||||||||||
Regression introduced in release | |||||||||||||||||||||||||||||||||
Regression introduced by commit | |||||||||||||||||||||||||||||||||
Triggers an Emergency Pack | No | ||||||||||||||||||||||||||||||||
Summary | 0036638: DalConnectionProvider(true) or () in combination with standard xsql causes 1 flush per SQL | ||||||||||||||||||||||||||||||||
Description | DalConnectionProvider 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 | ||||||||||||||||||||||||||||||||
Proposed Solution | |||||||||||||||||||||||||||||||||
Additional Information | |||||||||||||||||||||||||||||||||
Tags | Performance | ||||||||||||||||||||||||||||||||
Relationships |
| ||||||||||||||||||||||||||||||||
Attached Files | 36638-flushes.txt (203,273) 2017-08-10 17:18 https://issues.openbravo.com/file_download.php?file_id=10978&type=bug | ||||||||||||||||||||||||||||||||
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 |
There are no notes attached to this issue. |