Openbravo Issue Tracking System - Retail Modules |
View Issue Details |
|
ID | Project | Category | View Status | Date Submitted | Last Update |
0033162 | Retail Modules | Web POS | public | 2016-06-06 15:05 | 2017-11-30 09:29 |
|
Reporter | shuehner | |
Assigned To | shuehner | |
Priority | normal | Severity | major | Reproducibility | have not tried |
Status | closed | Resolution | fixed | |
Platform | | OS | 5 | OS Version | |
Product Version | | |
Target Version | | Fixed in Version | RR16Q3 | |
Merge Request Status | |
Review Assigned To | marvintm |
OBNetwork customer | No |
Support ticket | |
Regression level | |
Regression date | |
Regression introduced in release | |
Regression introduced by commit | |
Triggers an Emergency Pack | No |
|
Summary | 0033162: CashCloseProcessor.createReconciliation missing limit 1 to find last created one (reads all) |
Description | The code in createReconciliation wants to read the last reconciliation (ordered b y date) but does not add any limit to query.
so instead it loads all of the entries (for this account) instead of the single entry it needs. |
Steps To Reproduce | OBCriteria<FIN_Reconciliation> reconciliationsForAccount = OBDal.getInstance()
.createCriteria(FIN_Reconciliation.class);
reconciliationsForAccount.add(Restrictions.eq("account", account));
reconciliationsForAccount.addOrderBy("creationDate", false);
List<FIN_Reconciliation> reconciliations = reconciliationsForAccount.list();
if (reconciliations.size() == 0) {
startingBalance = account.getInitialBalance();
} else {
startingBalance = reconciliations.get(0).getEndingBalance();
}
|
Proposed Solution | add setMaxResults(1) |
Additional Information | |
Tags | Performance |
Relationships | depends on | backport | 0033213 | RR16Q2.1 | closed | Retail | CashCloseProcessor.createReconciliation missing limit 1 to find last created one (reads all) |
|
Attached Files | |
|
Issue History |
Date Modified | Username | Field | Change |
2016-06-06 15:05 | shuehner | New Issue | |
2016-06-06 15:05 | shuehner | Assigned To | => Retail |
2016-06-06 15:05 | shuehner | OBNetwork customer | => No |
2016-06-06 15:05 | shuehner | Triggers an Emergency Pack | => No |
2016-06-06 15:05 | shuehner | Tag Attached: Performance | |
2016-06-09 15:47 | hgbot | Checkin | |
2016-06-09 15:47 | hgbot | Note Added: 0087127 | |
2016-06-09 15:47 | hgbot | Checkin | |
2016-06-09 15:47 | hgbot | Note Added: 0087128 | |
2016-06-09 15:47 | hgbot | Status | new => resolved |
2016-06-09 15:47 | hgbot | Resolution | open => fixed |
2016-06-09 15:47 | hgbot | Fixed in SCM revision | => http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/ee2aa06af166b613e26d63fa3ff302ffce35f4b8 [^] |
2016-06-09 15:55 | shuehner | Assigned To | Retail => shuehner |
2016-06-09 15:56 | shuehner | Review Assigned To | => marvintm |
2016-06-09 15:56 | shuehner | Note Added: 0087136 | |
2016-06-09 15:56 | shuehner | Severity | minor => major |
2016-06-10 09:08 | marvintm | Status | resolved => new |
2016-06-10 09:08 | marvintm | Resolution | fixed => open |
2016-06-10 09:09 | marvintm | Status | new => scheduled |
2016-06-10 09:09 | marvintm | Status | scheduled => resolved |
2016-06-10 09:09 | marvintm | Fixed in Version | => RR15Q3 |
2016-06-10 09:09 | marvintm | Resolution | open => fixed |
2016-06-10 09:09 | marvintm | Status | resolved => closed |
2016-07-05 10:09 | hgbot | Checkin | |
2016-07-05 10:09 | hgbot | Note Added: 0088191 | |
2016-07-05 10:09 | hgbot | Checkin | |
2016-07-05 10:09 | hgbot | Note Added: 0088192 | |
2016-07-05 10:09 | hgbot | Status | closed => resolved |
2016-07-05 10:09 | hgbot | Fixed in SCM revision | http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/ee2aa06af166b613e26d63fa3ff302ffce35f4b8 [^] => http://code.openbravo.com/retail/backports/3.0RR16Q2.1/org.openbravo.retail.posterminal/rev/fa428be2be9030fe1c20d4f44b119552f7a261f6 [^] |
2016-07-05 10:11 | migueldejuana | Status | resolved => closed |
2017-11-30 09:29 | shuehner | Fixed in Version | RR15Q3 => RR16Q3 |
Notes |
|
(0087127)
|
hgbot
|
2016-06-09 15:47
|
|
|
|
(0087128)
|
hgbot
|
2016-06-09 15:47
|
|
Repository: erp/pmods/org.openbravo.retail.posterminal
Changeset: ee2aa06af166b613e26d63fa3ff302ffce35f4b8
Author: Stefan Hühner <stefan.huehner <at> openbravo.com>
Date: Tue Jun 07 17:10:14 2016 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/ee2aa06af166b613e26d63fa3ff302ffce35f4b8 [^]
Fixed 33162. Add 'limit 1' to query to avoid processing/loading all rows.
The query needs to find the latest FIN_Reconciliations for a account (order by
date) to get its ending balance.
However it did not hav a Limit 1 applied to the query so processes all rows for
this account and loaded all those rows into java memory even when needing only 1.
---
M src/org/openbravo/retail/posterminal/CashCloseProcessor.java
---
|
|
|
|
Raising to major as without it could trigger very high memory usage depending on number of transaction in the used account.
-> Candidate for backport to Q1 + Q2 |
|
|
(0088191)
|
hgbot
|
2016-07-05 10:09
|
|
|
|
(0088192)
|
hgbot
|
2016-07-05 10:09
|
|
Repository: retail/backports/3.0RR16Q2.1/org.openbravo.retail.posterminal
Changeset: fa428be2be9030fe1c20d4f44b119552f7a261f6
Author: Stefan Hühner <stefan.huehner <at> openbravo.com>
Date: Tue Jun 07 17:10:14 2016 +0200
URL: http://code.openbravo.com/retail/backports/3.0RR16Q2.1/org.openbravo.retail.posterminal/rev/fa428be2be9030fe1c20d4f44b119552f7a261f6 [^]
Fixed 33162. Add 'limit 1' to query to avoid processing/loading all rows.
The query needs to find the latest FIN_Reconciliations for a account (order by
date) to get its ending balance.
However it did not hav a Limit 1 applied to the query so processes all rows for
this account and loaded all those rows into java memory even when needing only 1.
---
M src/org/openbravo/retail/posterminal/CashCloseProcessor.java
---
|
|