Project:
| View Issue Details[ Jump to Notes ] | [ Issue History ] [ Print ] | ||||||||||
| ID | |||||||||||
| 0034770 | |||||||||||
| Type | Category | Severity | Reproducibility | Date Submitted | Last Update | ||||||
| feature request | [Openbravo ERP] A. Platform | minor | N/A | 2016-12-19 12:10 | 2022-02-01 08:09 | ||||||
| Reporter | caristu | View Status | public | ||||||||
| Assigned To | Triage Platform Base | ||||||||||
| Priority | normal | Resolution | open | Fixed in Version | |||||||
| Status | acknowledged | Fix in branch | Fixed in SCM revision | ||||||||
| Projection | none | ETA | none | Target Version | |||||||
| OS | Any | Database | Any | Java version | |||||||
| OS Version | Database version | Ant version | |||||||||
| Product Version | SCM revision | ||||||||||
| Merge Request Status | |||||||||||
| Review Assigned To | |||||||||||
| OBNetwork customer | No | ||||||||||
| 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 | ||||||||||
| Tags | No tags attached. | ||||||||||
| Attached Files | |||||||||||
Relationships [ Relation Graph ]
[ Dependency Graph ]
|
||||||||
|
||||||||
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 | OBNetwork customer | => No |
| 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 | View Revisions |
| 2016-12-19 12:14 | caristu | Steps to Reproduce Updated | View Revisions |
| 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 |
| Copyright © 2000 - 2009 MantisBT Group |