Project:
View Issue Details[ Jump to Notes ] | [ Issue History ] [ Print ] | |||||||
ID | ||||||||
0033213 | ||||||||
Type | Category | Severity | Reproducibility | Date Submitted | Last Update | |||
backport | [Retail Modules] Web POS | major | have not tried | 2016-06-06 15:05 | 2016-07-05 18:45 | |||
Reporter | shuehner | View Status | public | |||||
Assigned To | Retail | |||||||
Priority | normal | Resolution | fixed | Fixed in Version | ||||
Status | closed | Fix in branch | Fixed in SCM revision | |||||
Projection | none | ETA | none | Target Version | RR16Q2.1 | |||
OS | Any | Database | Any | Java version | ||||
OS Version | Database version | Ant version | ||||||
Product Version | SCM revision | |||||||
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 | 0033213: 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) | |||||||
Tags | No tags attached. | |||||||
Attached Files | ||||||||
![]() |
||||||||
|
![]() |
|
(0088195) migueldejuana (viewer) 2016-07-05 10:11 |
Repository: retail/backports/3.0RR16Q2.1/org.openbravo.retail.posterminal Changeset: d6f5c8598ec47453879b1a9486d87c820ec35334 Author: Stefan Hühner <stefan.huehner <at> openbravo.com> Date: Tue Jun 07 17:08:23 2016 +0200 URL: http://code.openbravo.com/retail/backports/3.0RR16Q2.1/org.openbravo.retail.posterminal/rev/d6f5c8598ec47453879b1a9486d87c820ec35334 [^] [^] Issue 33162. Reformat code before applying fix. --- M src/org/openbravo/retail/posterminal/CashCloseProcessor.java --- 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 --- |
![]() |
|||
Date Modified | Username | Field | Change |
2016-06-10 09:09 | marvintm | Type | defect => backport |
2016-06-10 09:09 | marvintm | Target Version | => RR16Q2.1 |
2016-06-10 10:49 | shuehner | Fixed in SCM revision | http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/ee2aa06af166b613e26d63fa3ff302ffce35f4b8 [^] => |
2016-06-13 16:29 | shuehner | Assigned To | shuehner => Retail |
2016-07-05 10:11 | migueldejuana | Note Added: 0088195 | |
2016-07-05 10:11 | migueldejuana | Status | scheduled => resolved |
2016-07-05 10:11 | migueldejuana | Resolution | open => fixed |
2016-07-05 18:45 | marvintm | Status | resolved => closed |
Copyright © 2000 - 2009 MantisBT Group |