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

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0033163
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Retail Modules] Web POSminorhave not tried2016-06-06 15:082017-11-30 10:14
ReportershuehnerView Statuspublic 
Assigned Toshuehner 
PrioritynormalResolutionfixedFixed in VersionRR16Q3
StatusclosedFix in branchFixed in SCM revisionfe29902d8af1
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned Tomarvintm
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0033163: CashCloseProcessor.createTotalTransferTransactionDeposit does c_currency read without needing it:

DescriptionThe function createTotalTransferTransactionDeposit:

has following code:
    if (!accountFrom.getCurrency().getId().equals(accountTo.getCurrency().getId())) {

Which triggers read from c_currency while not needing it
Steps To Reproduce246134 [Import Entry - 6] INFO org.openbravo.base.PoolInterceptor - executeQuery --- SQL:
select currency0_.C_Currency_ID as C1_175_0_, currency0_.AD_Client_ID as AD2_175_0_, currency0_.AD_Org_ID as AD3_175_0_, currency0_.IsActive as IsActive175_0_, currency0_.Created as Created175_0_, currency0_.CreatedBy as CreatedBy175_0_, currency0_.Updated as Updated175_0_, currency0_.UpdatedBy as UpdatedBy175_0_, currency0_.ISO_Code as ISO9_175_0_, currency0_.CurSymbol as CurSymbol175_0_, currency0_.Description as Descrip11_175_0_, currency0_.StdPrecision as StdPrec12_175_0_, currency0_.CostingPrecision as Costing13_175_0_, currency0_.PricePrecision as PricePr14_175_0_, currency0_.Issymbolrightside as Issymbo15_175_0_, currency0_.EM_Obpos_Posprecision as EM16_175_0_ from C_Currency currency0_ where currency0_.C_Currency_ID=?
  t:1
     $1: 102
java.lang.Exception
    at org.openbravo.base.PoolInterceptor$PSInvokationHandler.invoke(PoolInterceptor.java:99)
    at com.sun.proxy.$Proxy23.executeQuery(Unknown Source)
    at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:208)
    at org.hibernate.loader.Loader.getResultSet(Loader.java:1953)
    at org.hibernate.loader.Loader.doQuery(Loader.java:802)
    at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:274)
    at org.hibernate.loader.Loader.loadEntity(Loader.java:2037)
    at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:86)
    at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:76)
    at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:69)
    at org.hibernate.loader.entity.BatchingEntityLoader.load(BatchingEntityLoader.java:113)
    at org.hibernate.persister.entity.AbstractEntityPersister.load(AbstractEntityPersister.java:3293)
    at org.hibernate.event.def.DefaultLoadEventListener.loadFromDatasource(DefaultLoadEventListener.java:496)
    at org.hibernate.event.def.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:477)
    at org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoadEventListener.java:227)
    at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:147)
    at org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:1090)
    at org.hibernate.impl.SessionImpl.immediateLoad(SessionImpl.java:1026)
    at org.hibernate.proxy.AbstractLazyInitializer.initialize(AbstractLazyInitializer.java:176)
    at org.hibernate.proxy.AbstractLazyInitializer.getImplementation(AbstractLazyInitializer.java:215)
    at org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.invoke(JavassistLazyInitializer.java:190)
    at org.openbravo.model.common.currency.Currency_$$_javassist_348.getId(Currency_$$_javassist_348.java)
    at org.openbravo.retail.posterminal.CashCloseProcessor.createTotalTransferTransactionDeposit(CashCloseProcessor.java:350)
    at org.openbravo.retail.posterminal.CashCloseProcessor.processCashClose(CashCloseProcessor.java:120)
Proposed Solutionreplace by DalUtil.getId
TagsPerformance
Attached Files

- Relationships Relation Graph ] Dependency Graph ]

-  Notes
(0087129)
hgbot (developer)
2016-06-09 15:47

Repository: erp/pmods/org.openbravo.retail.posterminal
Changeset: fe29902d8af1c26b2bc49e10c830a0f790905534
Author: Stefan Hühner <stefan.huehner <at> openbravo.com>
Date: Tue Jun 07 17:15:06 2016 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/fe29902d8af1c26b2bc49e10c830a0f790905534 [^]

Fixed 33163. Avoid read from c_currency by using DalUtil.getId

to get only the getId of a dal object which has not been initialized
DalUtil.getId should be used as it avoid initializing the DAL Object
thus avoiding a unneeded database query.

---
M src/org/openbravo/retail/posterminal/CashCloseProcessor.java
---

- Issue History
Date Modified Username Field Change
2016-06-06 15:08 shuehner New Issue
2016-06-06 15:08 shuehner Assigned To => Retail
2016-06-06 15:08 shuehner Triggers an Emergency Pack => No
2016-06-06 15:08 shuehner Tag Attached: Performance
2016-06-09 15:47 hgbot Checkin
2016-06-09 15:47 hgbot Note Added: 0087129
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/fe29902d8af1c26b2bc49e10c830a0f790905534 [^]
2016-06-09 15:57 shuehner Assigned To Retail => shuehner
2016-06-09 15:57 shuehner Review Assigned To => marvintm
2016-06-10 09:10 marvintm Status resolved => closed
2017-11-30 10:14 shuehner Fixed in Version => RR16Q3


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker