Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0033790Openbravo ERPA. Platformpublic2016-08-24 11:412016-08-25 22:53
shuehner 
shuehner 
normalminorhave not tried
closedfixed 
5
 
3.0PR16Q4 
caristu
Core
No
0033790: Accidental double query in PriceListVersionFilterExpressionName (order lines, product selector dropdown)
That class has double query m_pricelist_version and also is missing a limit 1 so could lead to high mem usage.

Note: Code seems to be very similar or identical to the change reported in issue 33705
with debugging code from https://issues.openbravo.com/view.php?id=33767 [^]

Open Sales Order
create new header
In lines tab
Create new record in grid view
Click on product selector drop down and see debugging code fire
Performance
related to defect 0033705 closed shuehner Double query in PricelistVersionFilterExpression (product selector) 
related to feature request 0033767 closed platform Add code to auto-detect 'accidental double query' on same OBQuery or OBCriteria object 
related to defect 0033791 acknowledged Triage Finance PricelistVersionFilterExpression & PriceListVersionFilterExpressionName are 99% identical 
depends on backport 00338113.0PR16Q3.1 closed aferraz Accidental double query in PriceListVersionFilterExpressionName (order lines, product selector dropdown) 
depends on backport 00338123.0PR16Q2.3 closed aferraz Accidental double query in PriceListVersionFilterExpressionName (order lines, product selector dropdown) 
Issue History
2016-08-24 11:41shuehnerNew Issue
2016-08-24 11:41shuehnerAssigned To => platform
2016-08-24 11:41shuehnerModules => Core
2016-08-24 11:41shuehnerTriggers an Emergency Pack => No
2016-08-24 11:41shuehnerTag Attached: Performance
2016-08-24 11:41shuehnerRelationship addedrelated to 0033705
2016-08-24 11:41shuehnerRelationship addedrelated to 0033767
2016-08-24 11:47shuehnerRelationship addedrelated to 0033791
2016-08-24 11:55hgbotCheckin
2016-08-24 11:55hgbotNote Added: 0089338
2016-08-24 11:55hgbotStatusnew => resolved
2016-08-24 11:55hgbotResolutionopen => fixed
2016-08-24 11:55hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/c35e5b050f0baa6289ac1cb8c4b17fac389591c3 [^]
2016-08-24 11:55shuehnerReview Assigned To => caristu
2016-08-24 15:00shuehnerAssigned Toplatform => shuehner
2016-08-25 10:45caristuNote Added: 0089384
2016-08-25 10:45caristuStatusresolved => closed
2016-08-25 10:45caristuFixed in Version => 3.0PR16Q4
2016-08-25 14:20aferrazStatusclosed => new
2016-08-25 14:20aferrazResolutionfixed => open
2016-08-25 14:20aferrazFixed in Version3.0PR16Q4 =>
2016-08-25 14:25aferrazStatusnew => scheduled
2016-08-25 14:26aferrazStatusscheduled => resolved
2016-08-25 14:26aferrazFixed in Version => 3.0PR16Q4
2016-08-25 14:26aferrazResolutionopen => fixed
2016-08-25 14:26aferrazStatusresolved => closed
2016-08-25 15:11hgbotCheckin
2016-08-25 15:11hgbotNote Added: 0089402
2016-08-25 22:53hudsonbotCheckin
2016-08-25 22:53hudsonbotNote Added: 0089418

Notes
(0089338)
hgbot   
2016-08-24 11:55   
Repository: erp/devel/pi
Changeset: c35e5b050f0baa6289ac1cb8c4b17fac389591c3
Author: Stefan Hühner <stefan.huehner <at> openbravo.com>
Date: Wed Aug 24 11:54:52 2016 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/c35e5b050f0baa6289ac1cb8c4b17fac389591c3 [^]

Fixed 33790. Avoid double query with .count() + .list(). Add limit 1 to query

Query did .count() + then retrieve 1 record after adding extra order by.

This change removes the count as it only adds extra overhead and directly
does the real .list() query.
As the code only uses single row of result add extra limit 1 to reduce
number of result rows loaded into memory if many match the filter.
Simply code to use .uniqueResult() instead of .list().get(0)

---
M src/org/openbravo/erpCommon/info/PriceListVersionFilterExpressionName.java
---
(0089384)
caristu   
2016-08-25 10:45   
Code reviewed
(0089402)
hgbot   
2016-08-25 15:11   
Repository: erp/devel/pi
Changeset: d058534c944a8a56a3e1be2d298bb26c22f5b7ff
Author: Alvaro Ferraz <alvaro.ferraz <at> openbravo.com>
Date: Thu Aug 25 15:08:57 2016 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/d058534c944a8a56a3e1be2d298bb26c22f5b7ff [^]

Related to issue 33790: Update copyright

---
M src/org/openbravo/erpCommon/info/PriceListVersionFilterExpressionName.java
---
(0089418)
hudsonbot   
2016-08-25 22:53   
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/5e50832c9b35 [^]
Maturity status: Test