Project:
View Issue Details[ Jump to Notes ] | [ Issue History ] [ Print ] | |||||||
ID | ||||||||
0033767 | ||||||||
Type | Category | Severity | Reproducibility | Date Submitted | Last Update | |||
feature request | [Openbravo ERP] A. Platform | minor | have not tried | 2016-08-23 14:43 | 2016-12-19 12:17 | |||
Reporter | shuehner | View Status | public | |||||
Assigned To | platform | |||||||
Priority | normal | Resolution | fixed | Fixed in Version | 3.0PR17Q1 | |||
Status | closed | 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 | |||||||
Review Assigned To | caristu | |||||||
Web browser | ||||||||
Modules | Core | |||||||
Regression level | ||||||||
Regression date | ||||||||
Regression introduced in release | ||||||||
Regression introduced by commit | ||||||||
Triggers an Emergency Pack | No | |||||||
Summary | 0033767: Add code to auto-detect 'accidental double query' on same OBQuery or OBCriteria object | |||||||
Description | There is a quite common bad coding pattern which calls '.list()' more than one time on the same OBCriteria or 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 | https://issues.openbravo.com/view.php?id=33703 [^] https://issues.openbravo.com/view.php?id=33704 [^] https://issues.openbravo.com/view.php?id=33705 [^] https://issues.openbravo.com/view.php?id=33706 [^] https://issues.openbravo.com/view.php?id=33707 [^] https://issues.openbravo.com/view.php?id=33709 [^] | |||||||
Tags | Performance | |||||||
Attached Files | 33767_prototype.diff [^] (4,677 bytes) 2016-08-23 14:44 [Show Content] | |||||||
Relationships [ Relation Graph ] [ Dependency Graph ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Notes | |
(0092758) caristu (developer) 2016-12-19 10:49 edited on: 2016-12-19 10:52 |
Accidental double query in OBCriteria is now detected with the fix for issue 0033816. It will be detected because the initialized method of the OBCriteria instance will be invoked twice, and in that case a warning is displayed in the log. |
(0092772) caristu (developer) 2016-12-19 12:17 |
Fixed for OBCriteria with the fix for issue 0033816. A new issue for OBQuery class has been created: 0034770. |
Issue History | |||
Date Modified | Username | Field | Change |
2016-08-23 14:43 | shuehner | New Issue | |
2016-08-23 14:43 | shuehner | Assigned To | => platform |
2016-08-23 14:43 | shuehner | Modules | => Core |
2016-08-23 14:43 | shuehner | Triggers an Emergency Pack | => No |
2016-08-23 14:43 | shuehner | Tag Attached: Performance | |
2016-08-23 14:44 | shuehner | File Added: 33767_prototype.diff | |
2016-08-23 14:44 | shuehner | Relationship added | related to 0033703 |
2016-08-23 14:44 | shuehner | Relationship added | related to 0033704 |
2016-08-23 14:44 | shuehner | Relationship added | related to 0033705 |
2016-08-23 14:44 | shuehner | Relationship added | related to 0033706 |
2016-08-23 14:44 | shuehner | Relationship added | related to 0033707 |
2016-08-23 14:45 | shuehner | Relationship added | related to 0033709 |
2016-08-23 16:37 | shuehner | Relationship added | related to 0033769 |
2016-08-23 17:03 | shuehner | Relationship added | related to 0033770 |
2016-08-23 17:14 | shuehner | Relationship added | related to 0033771 |
2016-08-23 17:20 | shuehner | Relationship added | related to 0033772 |
2016-08-23 17:33 | shuehner | Relationship added | related to 0033773 |
2016-08-23 17:57 | shuehner | Relationship added | related to 0033774 |
2016-08-24 11:04 | shuehner | Relationship added | related to 0033789 |
2016-08-24 11:41 | shuehner | Relationship added | related to 0033790 |
2016-08-24 14:21 | shuehner | Relationship added | related to 0033794 |
2016-08-24 15:01 | shuehner | Relationship added | related to 0033158 |
2016-12-19 10:21 | caristu | Relationship added | related to 0033816 |
2016-12-19 10:49 | caristu | Note Added: 0092758 | |
2016-12-19 10:51 | caristu | Note Edited: 0092758 | View Revisions |
2016-12-19 10:52 | caristu | Note Edited: 0092758 | View Revisions |
2016-12-19 12:10 | caristu | Issue cloned | 0034770 |
2016-12-19 12:10 | caristu | Relationship added | related to 0034770 |
2016-12-19 12:17 | caristu | Review Assigned To | => caristu |
2016-12-19 12:17 | caristu | Note Added: 0092772 | |
2016-12-19 12:17 | caristu | Status | new => closed |
2016-12-19 12:17 | caristu | Resolution | open => fixed |
2016-12-19 12:17 | caristu | Fixed in Version | => 3.0PR17Q1 |
2017-09-19 18:48 | markmm82 | Relationship added | related to 0036898 |
Copyright © 2000 - 2009 MantisBT Group |