Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0037358Openbravo ERPA. Platformpublic2017-11-22 12:432018-01-03 12:39
shuehner 
inigosanchez 
urgentminorhave not tried
closedfixed 
5
 
3.0PR18Q1 
alostale
Core
No
0037358: Avoid query to AttributeData.selectOrgCurrency during login if system does not have any accounting schema.
The following code is from LoginUtils.fillSessionArguments running during login.

It is running always and internally using ad_isorgincluded which can be slow after its recent refactor.
      // set organization currency
      orgCurrency = AttributeData.selectOrgCurrency(conn, strOrg, strCliente);

But the only usage later in this file is:
        if (attr != null && attr.length > 0) {
          vars.setSessionValue("$C_AcctSchema_ID", attr[0].value);
          if (orgCurrency.length > 0) {
            vars.setSessionValue("$C_Currency_ID", orgCurrency[0].cCurrencyId);

With attr being result of query to c_acctschema so only done if the system does at least have 1 accounting schema.

In cases where customer does not have any accounting schema that we could skip the selectOrgCurrencyQuery completely just my moving the call into the attr != null if.
-
Performance
related to feature request 0035553 closed caristu Improve scalability of the login process 
diff loginutils-skip_ad_isorgincluded-without-accounting.diff (1,133) 2017-11-22 14:47
https://issues.openbravo.com/file_download.php?file_id=11314&type=bug
Issue History
2017-11-22 12:43shuehnerNew Issue
2017-11-22 12:43shuehnerAssigned To => platform
2017-11-22 12:43shuehnerModules => Core
2017-11-22 12:43shuehnerTriggers an Emergency Pack => No
2017-11-22 12:43shuehnerTag Attached: Performance
2017-11-22 14:38alostaleStatusnew => acknowledged
2017-11-22 14:38alostalePrioritynormal => urgent
2017-11-22 14:47shuehnerFile Added: loginutils-skip_ad_isorgincluded-without-accounting.diff
2017-11-22 14:49shuehnerNote Added: 0100666
2017-11-22 14:52shuehnerRelationship addedrelated to 0035553
2017-11-23 10:38inigosanchezStatusacknowledged => scheduled
2017-11-23 10:38inigosanchezAssigned Toplatform => inigosanchez
2017-11-24 11:14inigosanchezReview Assigned To => alostale
2017-11-24 11:29hgbotCheckin
2017-11-24 11:29hgbotNote Added: 0100699
2017-11-24 11:29hgbotStatusscheduled => resolved
2017-11-24 11:29hgbotResolutionopen => fixed
2017-11-24 11:29hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/b8fc412fa8bf926dcde5fc8da7c2de6b5c4ffada [^]
2017-11-27 10:05alostaleNote Added: 0100725
2017-11-27 10:05alostaleStatusresolved => closed
2017-11-27 10:05alostaleFixed in Version => 3.0PR18Q1
2018-01-03 12:39hudsonbotCheckin
2018-01-03 12:39hudsonbotNote Added: 0101456

Notes
(0100666)
shuehner   
2017-11-22 14:49   
Note patch is for older 16Q1 release, so probably does not apply cleanly on tip. However checking manually same should be easily doable in latest code.
(0100699)
hgbot   
2017-11-24 11:29   
Repository: erp/devel/pi
Changeset: b8fc412fa8bf926dcde5fc8da7c2de6b5c4ffada
Author: Inigo Sanchez <inigo.sanchez <at> openbravo.com>
Date: Fri Nov 24 11:28:10 2017 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/b8fc412fa8bf926dcde5fc8da7c2de6b5c4ffada [^]

Fixed issue 37358: Avoid a query during login under some circumstances

Avoid query to AttributeData.selectOrgCurrency during login if system does not have any
accounting schema. In cases where customer does not have any accounting schema that we
could skip the selectOrgCurrency query completely. To take into account this improvement,
it is moved the AttributeData.selectOrgCurrency call.

Besides it is applied format properly to several comments.

---
M src/org/openbravo/base/secureApp/LoginUtils.java
---
(0100725)
alostale   
2017-11-27 10:05   
reviewed
(0101456)
hudsonbot   
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