Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0037455Openbravo ERP01. General setuppublic2017-12-12 10:152017-12-14 12:20
AtulOpenbravo 
AtulOpenbravo 
normalminorhave not tried
scheduledopen 
30Openbravo Appliance 14.04
 
 
Core
No
0037455: Detected slow piece of code in LoginUtils
In an environment with many organizations, get General Ledger of context organizations part in LoginUtils.java (specifically, the loop by organization and selectAcctSchema inside) is a bit slow and could be improved.

slow part:

        // Get General Ledger of context organizations
        if (ArrayUtils.isEmpty(attr)) {
          String[] orgList = Utility.getContext(conn, vars, "#User_Org", "LoginHandler")
              .replace("'", "").split(",");
          for (String orgId : orgList) {
            if (!StringUtils.equals(orgId, strOrg)) {
              acctSchemaId = OBLedgerUtils.getOrgLedger(orgId);
              if (StringUtils.isNotEmpty(acctSchemaId)) {
                attr = AttributeData.selectAcctSchema(conn, acctSchemaId,
                    Utility.getContext(conn, vars, "#User_Client", "LoginHandler"));
                if (ArrayUtils.isNotEmpty(attr)) {
                  break;
                }
              }
            }
          }
        }

The system searches for a valid acct schema using a dummy algorithm. If we search using a smarter way, we could improve the performance of this piece.
Login in the ERP
Open developer tools
Change the role to a role with access to many organizations
Verify this piece of code is slow.
Performance
related to defect 0037277 closed AtulOpenbravo Change the role in the ERP has performance problems 
Issue History
2017-12-12 10:15AtulOpenbravoNew Issue
2017-12-12 10:15AtulOpenbravoAssigned To => AtulOpenbravo
2017-12-12 10:15AtulOpenbravoModules => Core
2017-12-12 10:15AtulOpenbravoResolution time => 1512342000
2017-12-12 10:15AtulOpenbravoTriggers an Emergency Pack => No
2017-12-12 10:15AtulOpenbravoIssue generated from0037277
2017-12-12 10:15AtulOpenbravoRelationship addedrelated to 0037277
2017-12-12 10:38AtulOpenbravoStatusnew => scheduled
2017-12-12 11:39vmromanosResolution time1512342000 =>
2017-12-14 12:05shuehnerTag Attached: Performance
2017-12-14 12:20vmromanosSeveritymajor => minor
2017-12-14 12:20vmromanosSummaryChange the role in the ERP has performance problems => Detected slow piece of code in LoginUtils
2017-12-14 12:20vmromanosDescription Updatedbug_revision_view_page.php?rev_id=16452#r16452
2017-12-14 12:20vmromanosSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=16454#r16454

There are no notes attached to this issue.