Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0034010Openbravo ERPI. Performancepublic2016-09-14 13:292016-09-19 11:27
gorkaion 
gorkaion 
normalminorhave not tried
closedfixed 
5
 
3.0PR16Q3.23.0PR16Q3.2 
aferraz
Core
No
0034010: Slow login loading organization's default ledgers
On a system with +200 organizations the login can take more than 2 seconds. In particular OBLedgerUtils.getOrgLedgerRecursive() method's query takes more 1.5 seconds.
On a system with +200 organizations try to login.
Check that the mentioned method takes too much time by adding some logs or measuring it with YourKit.
remove the query that filters and order by slow ad_isorgincluded procedure
No tags attached.
blocks defect 0033989 closed gorkaion Slow login loading organization's default ledgers 
Issue History
2016-09-16 10:38aferrazTypedefect => backport
2016-09-16 10:38aferrazTarget Version => 3.0PR16Q3.2
2016-09-19 11:24hgbotCheckin
2016-09-19 11:24hgbotNote Added: 0090052
2016-09-19 11:24hgbotStatusscheduled => resolved
2016-09-19 11:24hgbotResolutionopen => fixed
2016-09-19 11:24hgbotFixed in SCM revision => http://code.openbravo.com/erp/backports/3.0PR16Q3.2/rev/f3f2391a134630de1f41b801330071d4efa2daf3 [^]
2016-09-19 11:24hgbotCheckin
2016-09-19 11:24hgbotNote Added: 0090053
2016-09-19 11:27aferrazReview Assigned To => aferraz
2016-09-19 11:27aferrazNote Added: 0090055
2016-09-19 11:27aferrazStatusresolved => closed
2016-09-19 11:27aferrazFixed in Version => 3.0PR16Q3.2

Notes
(0090052)
hgbot   
2016-09-19 11:24   
Repository: erp/backports/3.0PR16Q3.2
Changeset: f3f2391a134630de1f41b801330071d4efa2daf3
Author: Gorka Ion Damián <gorkaion.damian <at> openbravo.com>
Date: Wed Sep 14 13:39:12 2016 +0200
URL: http://code.openbravo.com/erp/backports/3.0PR16Q3.2/rev/f3f2391a134630de1f41b801330071d4efa2daf3 [^]

Fixed issue 34010. Removed slow query getting Organization Ledger.

The method to get the default General Ledget was using a query that filtered
and sorted the results using ad_isorgincluded procedure. In case of having a
large number of organizations this query was slow.

The method is now using the OrganizationStructureProvider to get the parent
organization List of the required org to search the default General Ledger.

---
M src/org/openbravo/erpCommon/utility/OBLedgerUtils.java
---
(0090053)
hgbot   
2016-09-19 11:24   
Repository: erp/backports/3.0PR16Q3.2
Changeset: 58c8fdd8d3d0666c11fb52b83bd6d2a77c9b1455
Author: Alvaro Ferraz <alvaro.ferraz <at> openbravo.com>
Date: Mon Sep 19 11:14:46 2016 +0200
URL: http://code.openbravo.com/erp/backports/3.0PR16Q3.2/rev/58c8fdd8d3d0666c11fb52b83bd6d2a77c9b1455 [^]

Related to issue 34010: Code review improvements

- Avoid setting admin mode in getOrgLedgerRecursive() and getClientLedger() methods as it is already done in getOrgLedger() method in OBLedgerUtils class.
- Retrieve first, general ledger of login organization in LoginUtils class. If no result is retrieved, we will retrieve general ledger of rest of context organizations.

---
M src/org/openbravo/base/secureApp/LoginUtils.java
M src/org/openbravo/erpCommon/utility/OBLedgerUtils.java
---
(0090055)
aferraz   
2016-09-19 11:27   
Code review + Testing OK