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

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0033706
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] A. Platformminorhave not tried2016-08-12 17:362016-08-24 22:47
ReportershuehnerView Statuspublic 
Assigned Toshuehner 
PrioritynormalResolutionfixedFixed in Version3.0PR16Q4
StatusclosedFix in branchFixed in SCM revision741a356c2150
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned Tocaristu
Web browser
ModulesCore
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0033706: SelectorDataSourceFilter does accidental extra queries in 'Add Payment' flow of Sales Orders

DescriptionThis class does some accidental extra queries by calling .list() several time for the same OBCriteria instance.

        OBCriteria<Parameter> qParam = OBDal.getInstance().createCriteria(Parameter.class);
        qParam.add(Restrictions.eq(Parameter.PROPERTY_ID,
            parameters.get(SelectorConstants.DS_REQUEST_SELECTOR_FIELD_ID)));

        Parameter param = qParam.list().get(0);
        Validation validation = qParam.list().get(0).getValidation();
        if (validation != null) {
          if (validation.getType().equals("HQL_JS")) {
            String validationCode = qParam.list().get(0).getValidation().getValidationCode();

Also that code does read parameter via its primary key.

So query could instead be just a OBDal.getInstance().get call
Steps To Reproduce1.) Create sales order with 1 line and book it.
2.) Open 'Add Payment' via toolbar button
3.) Review extra queries to obuiapp_parameter done in step 2
TagsPerformance
Attached Files

- Relationships Relation Graph ] Dependency Graph ]
related to defect 0033704 closedshuehner Accidental double query in 'selector dropdown' of new style selectors 
related to feature request 0033767 closedplatform Add code to auto-detect 'accidental double query' on same OBQuery or OBCriteria object 
related to design defect 0036898 newTriage Finance Performance issues when using DAL 

-  Notes
(0089304)
hgbot (developer)
2016-08-23 14:33

Repository: erp/devel/pi
Changeset: 741a356c2150eeefa997b0dbbef653349330cd4f
Author: Stefan Hühner <stefan.huehner <at> openbravo.com>
Date: Fri Aug 12 17:43:20 2016 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/741a356c2150eeefa997b0dbbef653349330cd4f [^]

Fixed 33706. Replace triple .list() call by single query.

Avoid 2 extra queries by saving .list() result instead of calling it 3 times.

Simplify query to OBDal.get (by primary key) as that is only filter which was
used in the OBCriteria.

---
M modules/org.openbravo.userinterface.selector/src/org/openbravo/userinterface/selector/SelectorDataSourceFilter.java
---
(0089358)
hgbot (developer)
2016-08-24 15:50

Repository: erp/devel/pi
Changeset: a730e671babce9926f44e0c2b59fd4b474afe693
Author: Carlos Aristu <carlos.aristu <at> openbravo.com>
Date: Wed Aug 24 15:49:21 2016 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/a730e671babce9926f44e0c2b59fd4b474afe693 [^]

related to issue 33706: code review improvements

---
M modules/org.openbravo.userinterface.selector/src/org/openbravo/userinterface/selector/SelectorDataSourceFilter.java
---
(0089359)
caristu (developer)
2016-08-24 15:51

Code review + testing OK: removed extra queries to obuiapp_parameter table
(0089369)
hudsonbot (developer)
2016-08-24 22:47

A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/badbe5df5566 [^]
Maturity status: Test

- Issue History
Date Modified Username Field Change
2016-08-12 17:36 shuehner New Issue
2016-08-12 17:36 shuehner Assigned To => platform
2016-08-12 17:36 shuehner Modules => Core
2016-08-12 17:36 shuehner Triggers an Emergency Pack => No
2016-08-12 17:36 shuehner Relationship added related to 0033704
2016-08-12 17:38 shuehner Description Updated View Revisions
2016-08-12 18:09 shuehner Tag Attached: Performance
2016-08-12 18:09 shuehner Assigned To platform => shuehner
2016-08-23 14:33 hgbot Checkin
2016-08-23 14:33 hgbot Note Added: 0089304
2016-08-23 14:33 hgbot Status new => resolved
2016-08-23 14:33 hgbot Resolution open => fixed
2016-08-23 14:33 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/741a356c2150eeefa997b0dbbef653349330cd4f [^]
2016-08-23 14:34 shuehner Review Assigned To => caristu
2016-08-23 14:44 shuehner Relationship added related to 0033767
2016-08-24 15:50 hgbot Checkin
2016-08-24 15:50 hgbot Note Added: 0089358
2016-08-24 15:51 caristu Note Added: 0089359
2016-08-24 15:51 caristu Status resolved => closed
2016-08-24 15:51 caristu Fixed in Version => 3.0PR16Q4
2016-08-24 22:47 hudsonbot Checkin
2016-08-24 22:47 hudsonbot Note Added: 0089369
2017-09-19 18:49 markmm82 Relationship added related to 0036898


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker