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

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0037419
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] A. Platformtrivialhave not tried2017-11-29 17:402018-01-03 12:39
ReportershuehnerView Statuspublic 
Assigned Toshuehner 
PrioritynormalResolutionfixedFixed in Version3.0PR18Q1
StatusclosedFix in branchFixed in SCM revision754d0d843ec5
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned Toalostale
Web browser
ModulesCore
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0037419: ERP & POS Login do (up to) 3 useless db reads in SessionLogin.java by not using getProxy

DescriptionSessionLogin.java in its save method is not using getProxy for accessing Client, Organization & User.

That causes a db-read each which should be avoided.

Note: that ad_client read in practice does not happen as currently some earlier code in login did load it already
Steps To ReproduceDo a login with org.openbravo.util.db module active and trace all queries.

280479 [http-bio-8080-exec-2] INFO org.openbravo.util.db.StatementInvocationHandler - executeQuery --- SQL:
select organizati0_.AD_Org_ID as AD1_517_0_, organizati0_.AD_Client_ID as AD2_517_0_, organizati0_.IsActive as IsActive517_0_, organizati0_.Created as Created517_0_, organizati0_.CreatedBy as CreatedBy517_0_, organizati0_.Updated as Updated517_0_, organizati0_.UpdatedBy as UpdatedBy517_0_, organizati0_.Value as Value517_0_, organizati0_.Name as Name517_0_, organizati0_.Description as Descrip10_517_0_, organizati0_.IsSummary as IsSummary517_0_, organizati0_.AD_Orgtype_ID as AD12_517_0_, organizati0_.IsPeriodControlAllowed as IsPerio13_517_0_, organizati0_.C_Calendar_ID as C14_517_0_, organizati0_.IsReady as IsReady517_0_, organizati0_.Social_Name as Social16_517_0_, organizati0_.C_Currency_ID as C17_517_0_, organizati0_.EM_OBRETCO_RetailOrgType as EM18_517_0_, organizati0_.EM_OBRETCO_Pricelist_ID as EM19_517_0_, organizati0_.C_Acctschema_ID as C20_517_0_, organizati0_.EM_OBRETCO_Productlist_ID as EM21_517_0_, organizati0_.EM_Obretco_C_Bpartner_ID as EM22_517_0_, organizati0_.EM_Obretco_C_bp_Location_ID as EM23_517_0_, organizati0_.EM_Obretco_M_Warehouse_ID as EM24_517_0_, organizati0_.EM_Obretco_dbp_irulesid as EM25_517_0_, organizati0_.EM_Obretco_dbp_ptermid as EM26_517_0_, organizati0_.EM_Obretco_dbp_pmethodid as EM27_517_0_, organizati0_.EM_Obretco_dbp_bpcatid as EM28_517_0_, organizati0_.EM_Obretco_dbp_countryid as EM29_517_0_, organizati0_.EM_Obretco_dbp_orgid as EM30_517_0_, organizati0_.EM_Obretco_Showtaxid as EM31_517_0_, organizati0_.EM_Obpos_Ticket_Template_ID as EM32_517_0_, organizati0_.EM_Obretco_Showbpcategory as EM33_517_0_, organizati0_.EM_Obpos_Cashup_Template_ID as EM34_517_0_, organizati0_.EM_Obpos_Format_Decimal as EM35_517_0_, organizati0_.EM_Obpos_Format_Group as EM36_517_0_, organizati0_.EM_Obpos_Date_Format as EM37_517_0_, organizati0_.EM_Obpos_Closedreceipt_Tem_ID as EM38_517_0_, organizati0_.EM_Obpos_Invoice_Template_ID as EM39_517_0_, organizati0_.EM_Obpos_Ret_Inv_Template_ID as EM40_517_0_, organizati0_.EM_Obpos_Layaway_Template_ID as EM41_517_0_, organizati0_.EM_Obpos_Return_Template_ID as EM42_517_0_, organizati0_.EM_Obpos_Quot_Template_ID as EM43_517_0_, organizati0_.EM_Obpos_Count_Diff_Limit as EM44_517_0_, organizati0_.EM_Obpos_Select_Cc_Warehouse as EM45_517_0_, organizati0_.EM_Obpos_Warehouse_Selection as EM46_517_0_, organizati0_.EM_Obpos_Layaway_Anonymousbp as EM47_517_0_, organizati0_.EM_Obpos_Layaway_Partpaid as EM48_517_0_, organizati0_.EM_Obpos_Currency_Format as EM49_517_0_, organizati0_.EM_Obpos_Welcome_Template_ID as EM50_517_0_, organizati0_.EM_Obpos_Cashmgm_Template_ID as EM51_517_0_, organizati0_.EM_Obpos_Clo_Inv_Template_ID as EM52_517_0_, organizati0_.EM_Obpos_Canc_Rpt_Template_ID as EM53_517_0_ from AD_Org organizati0_ where organizati0_.AD_Org_ID=?
  t:2
     $1: 0
   org.openbravo.base.PoolInterceptor$PSInvokationHandler.invoke(PoolInterceptor.java:86)
   sun.reflect.GeneratedMethodAccessor158.invoke(Unknown Source)
   sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   java.lang.reflect.Method.invoke(Method.java:606)
   org.openbravo.dal.core.SessionHandler.find(SessionHandler.java:534)
   org.openbravo.dal.core.SessionHandler.find(SessionHandler.java:500)
   org.openbravo.dal.service.OBDal.get(OBDal.java:353)
   org.openbravo.erpCommon.security.SessionLogin.save(SessionLogin.java:135)

280482 [http-bio-8080-exec-2] INFO org.openbravo.util.db.StatementInvocationHandler - executeQuery --- SQL:
select aduser0_.AD_User_ID as AD1_108_0_, aduser0_.AD_Client_ID as AD2_108_0_, aduser0_.AD_Org_ID as AD3_108_0_, aduser0_.IsActive as IsActive108_0_, aduser0_.Created as Created108_0_, aduser0_.CreatedBy as CreatedBy108_0_, aduser0_.Updated as Updated108_0_, aduser0_.UpdatedBy as UpdatedBy108_0_, aduser0_.Name as Name108_0_, aduser0_.Description as Descrip10_108_0_, aduser0_.Password as Password108_0_, aduser0_.Email as Email108_0_, aduser0_.Supervisor_ID as Supervisor13_108_0_, aduser0_.C_BPartner_ID as C14_108_0_, aduser0_.Processing as Processing108_0_, aduser0_.EmailUser as EmailUser108_0_, aduser0_.EmailUserPW as EmailUs17_108_0_, aduser0_.C_BPartner_Location_ID as C18_108_0_, aduser0_.C_Greeting_ID as C19_108_0_, aduser0_.Title as Title108_0_, aduser0_.Comments as Comments108_0_, aduser0_.Phone as Phone108_0_, aduser0_.Phone2 as Phone23_108_0_, aduser0_.Fax as Fax108_0_, aduser0_.LastContact as LastCon25_108_0_, aduser0_.LastResult as LastResult108_0_, aduser0_.Birthday as Birthday108_0_, aduser0_.AD_OrgTrx_ID as AD28_108_0_, aduser0_.Firstname as Firstname108_0_, aduser0_.Lastname as Lastname108_0_, aduser0_.UserName as UserName108_0_, aduser0_.Default_Ad_Client_ID as Default32_108_0_, aduser0_.Default_Ad_Language as Default33_108_0_, aduser0_.Default_Ad_Org_ID as Default34_108_0_, aduser0_.Default_Ad_Role_ID as Default35_108_0_, aduser0_.Default_M_Warehouse_ID as Default36_108_0_, aduser0_.IsLocked as IsLocked108_0_, aduser0_.AD_Image_ID as AD38_108_0_, aduser0_.EM_OBPOS_Default_Pos_Role as EM39_108_0_, aduser0_.Grant_Portal_Access as Grant40_108_0_, aduser0_.LastPasswordUpdate as LastPas41_108_0_, aduser0_.Isexpiredpassword as Isexpir42_108_0_ from AD_User aduser0_ where aduser0_.AD_User_ID in (?, ?)
  t:2
     $1: E49545E7D0A2413E90C31C2CDC2153B1
     $2: 0
   org.openbravo.base.PoolInterceptor$PSInvokationHandler.invoke(PoolInterceptor.java:86)
   sun.reflect.GeneratedMethodAccessor158.invoke(Unknown Source)
   sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   java.lang.reflect.Method.invoke(Method.java:606)
   org.openbravo.dal.core.SessionHandler.find(SessionHandler.java:534)
   org.openbravo.dal.core.SessionHandler.find(SessionHandler.java:500)
   org.openbravo.dal.service.OBDal.get(OBDal.java:353)
   org.openbravo.erpCommon.security.SessionLogin.save(SessionLogin.java:137)

280489 [http-bio-8080-exec-2] INFO org.openbravo.util.db.StatementInvocationHandler - executeBatch --- SQL:
Proposed SolutionUse getProxy instead
TagsPerformance
Attached Filesdiff file icon 37419.diff [^] (995 bytes) 2017-11-29 17:58 [Show Content]

- Relationships Relation Graph ] Dependency Graph ]

-  Notes
(0100816)
hgbot (developer)
2017-11-30 09:04

Repository: erp/devel/pi
Changeset: 754d0d843ec5f3494992d7eb98b80810750f9f87
Author: Stefan Hühner <stefan.huehner <at> openbravo.com>
Date: Thu Nov 30 09:04:32 2017 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/754d0d843ec5f3494992d7eb98b80810750f9f87 [^]

fixed bug 37419: Login does 3 useless db reads in SessionLogin

  Those db queries were used to load by ID DAL objects that were used just to
  create a new object but never used again.

  Replaced by getProxy so that no need to fetch them from DB.

---
M src/org/openbravo/erpCommon/security/SessionLogin.java
---
(0100817)
alostale (manager)
2017-11-30 09:05

reviewed + tested
(0101497)
hudsonbot (developer)
2018-01-03 12:39

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/c81e0d3cbab5 [^]
Maturity status: Test

- Issue History
Date Modified Username Field Change
2017-11-29 17:40 shuehner New Issue
2017-11-29 17:40 shuehner Assigned To => platform
2017-11-29 17:40 shuehner Modules => Core
2017-11-29 17:40 shuehner Triggers an Emergency Pack => No
2017-11-29 17:40 shuehner Tag Attached: Performance
2017-11-29 17:58 shuehner File Added: 37419.diff
2017-11-30 09:04 alostale Assigned To platform => shuehner
2017-11-30 09:04 hgbot Checkin
2017-11-30 09:04 hgbot Note Added: 0100816
2017-11-30 09:04 hgbot Status new => resolved
2017-11-30 09:04 hgbot Resolution open => fixed
2017-11-30 09:04 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/754d0d843ec5f3494992d7eb98b80810750f9f87 [^]
2017-11-30 09:05 alostale Review Assigned To => alostale
2017-11-30 09:05 alostale Note Added: 0100817
2017-11-30 09:05 alostale Status resolved => closed
2017-11-30 09:05 alostale Fixed in Version => 3.0PR18Q1
2018-01-03 12:39 hudsonbot Checkin
2018-01-03 12:39 hudsonbot Note Added: 0101497


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker