Openbravo Issue Tracking System - Retail Modules | ||||||||||||
View Issue Details | ||||||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | |||||||
0033616 | Retail Modules | Web POS | public | 2016-06-05 15:12 | 2016-08-18 11:48 | |||||||
Reporter | shuehner | |||||||||||
Assigned To | Retail | |||||||||||
Priority | normal | Severity | major | Reproducibility | have not tried | |||||||
Status | closed | Resolution | fixed | |||||||||
Platform | OS | 5 | OS Version | |||||||||
Product Version | ||||||||||||
Target Version | RR16Q2.2 | Fixed in Version | RR16Q2.2 | |||||||||
Merge Request Status | ||||||||||||
Review Assigned To | guilleaer | |||||||||||
OBNetwork customer | No | |||||||||||
Support ticket | ||||||||||||
Regression level | ||||||||||||
Regression date | ||||||||||||
Regression introduced in release | ||||||||||||
Regression introduced by commit | ||||||||||||
Triggers an Emergency Pack | No | |||||||||||
Summary | 0033616: OrderLoader: Inefficient check for m_locator doing 2-3 queries for the same | |||||||||||
Description | OrderLoader is querying m_locator (for order.getWarehouse()) essentially up to 3 times 1.) just after 'if (createShipment)' to see if none are present and error out 2.) a few lines later in call to createShipment doing .count() to check if exactly one is present 3.) then just after that said count another .uniqueResult() to retrieve that 'exactly one' All those can be done with a single sql. | |||||||||||
Steps To Reproduce | Trace SQL done by OrderLoader. | |||||||||||
Proposed Solution | Replace all 3 calls by single query. Adding simple .setMaxResults(2) and .list() gives us all the info we need and the limit 2 avoids ever reading >2 rows into memory. Note: Even while only wanting .count()==1 and reading single row we need to use a limit of 2 to distinguish the count=1 or count>1 case. As we only care about count being exactly 1 (or not) we do not need to do proper count for any values >1 to the limit 2 does the trick nicely. | |||||||||||
Additional Information | ||||||||||||
Tags | No tags attached. | |||||||||||
Relationships |
| |||||||||||
Attached Files | ||||||||||||
Issue History | ||||||||||||
Date Modified | Username | Field | Change | |||||||||
2016-08-03 14:26 | marvintm | Type | defect => backport | |||||||||
2016-08-03 14:26 | marvintm | Target Version | => RR16Q2.2 | |||||||||
2016-08-17 21:49 | hgbot | Checkin | ||||||||||
2016-08-17 21:49 | hgbot | Note Added: 0089188 | ||||||||||
2016-08-17 21:49 | hgbot | Status | scheduled => resolved | |||||||||
2016-08-17 21:49 | hgbot | Resolution | open => fixed | |||||||||
2016-08-17 21:49 | hgbot | Fixed in SCM revision | => http://code.openbravo.com/retail/backports/3.0RR16Q2.2/org.openbravo.retail.posterminal/rev/504b62d53b98648654163bb4b1fb7560c8c2b57e [^] | |||||||||
2016-08-18 11:48 | guilleaer | Review Assigned To | => guilleaer | |||||||||
2016-08-18 11:48 | guilleaer | Status | resolved => closed | |||||||||
2016-08-18 11:48 | guilleaer | Fixed in Version | => RR16Q2.2 |
Notes | |||||
|
|||||
|
|