Openbravo Issue Tracking System - Openbravo ERP | ||||||||||||
View Issue Details | ||||||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | |||||||
0034770 | Openbravo ERP | A. Platform | public | 2016-12-19 12:10 | 2022-02-01 08:09 | |||||||
Reporter | caristu | |||||||||||
Assigned To | Triage Platform Base | |||||||||||
Priority | normal | Severity | minor | Reproducibility | N/A | |||||||
Status | acknowledged | 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 | 0034770: Add code to auto-detect 'accidental double query' on same OBQuery object | |||||||||||
Description | There is a quite common bad coding pattern which calls '.list()' more than one time on the same OBQuery object. That will call the underlying sql query also 2 times. Similar some code without good reason calls .count() + then .list() on the same instance. Which leads to a 'select count(*)' + then another 'select *' sql query. Detecting such pattern is easy with some extra debugging code inside those 2 utility classes. See attached patch for a rough patch doing some simple tracking. Not polished yet but did already find 6 issues in fast manual testing + more 'to be triaged' when running erp-try with it applied. The attached patch logs a WARN + a stacktrace of the location of and 2nd or 3rd call to either list,count,scroll.uniqueResult. In practice that 2nd location is enough as a pointer and finding the first call in code is very easy in all examples observed so far. | |||||||||||
Steps To Reproduce | In description | |||||||||||
Proposed Solution | ||||||||||||
Additional Information | ||||||||||||
Tags | No tags attached. | |||||||||||
Relationships |
| |||||||||||
Attached Files | 34770_prototype.diff (4,677) 2016-12-19 12:15 https://issues.openbravo.com/file_download.php?file_id=10192&type=bug | |||||||||||
Issue History | ||||||||||||
Date Modified | Username | Field | Change | |||||||||
2016-12-19 12:10 | caristu | New Issue | ||||||||||
2016-12-19 12:10 | caristu | Assigned To | => platform | |||||||||
2016-12-19 12:10 | caristu | Modules | => Core | |||||||||
2016-12-19 12:10 | caristu | Triggers an Emergency Pack | => No | |||||||||
2016-12-19 12:10 | caristu | Issue generated from | 0033767 | |||||||||
2016-12-19 12:10 | caristu | Relationship added | related to 0033767 | |||||||||
2016-12-19 12:14 | caristu | Description Updated | bug_revision_view_page.php?rev_id=14054#r14054 | |||||||||
2016-12-19 12:14 | caristu | Steps to Reproduce Updated | bug_revision_view_page.php?rev_id=14056#r14056 | |||||||||
2016-12-19 12:15 | caristu | File Added: 34770_prototype.diff | ||||||||||
2016-12-19 12:49 | shuehner | Issue Monitored: shuehner | ||||||||||
2016-12-23 08:20 | caristu | Status | new => acknowledged | |||||||||
2022-02-01 08:09 | alostale | Assigned To | platform => Triage Platform Base |
There are no notes attached to this issue. |