Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0048756Openbravo ERP09. Financial managementpublic2022-03-10 07:292022-04-20 09:41
alostale 
alostale 
normalmajoralways
closedfixed 
5
 
PR22Q2 
Core
No
0048756: unnecesary OrganizationStructureProvider double initialization on ticket creation
As reported in 0042370, OrganizationStructureProvider initialization has an important impact in the overall database performance.

When creating tickets from the POS this initialization occurs twice per ticket:

1. Creating the context for processing the ticket (might be addressed by 0042370)
2. When obtaining document type (the goal of this issue).
In a retail instance:

1. Log in as System Admin and set debug log level to OrganizationStructureProvider
2. Log in POS and create one ticket
3. Check logs, there should be a single initialization there are two:

2022-03-10 07:28:36,465 [Import Entry - 9] DEBUG org.openbravo.dal.security.OrganizationStructureProvider - Client 39363B0921BB4293B48383844325E84C initialized in 1.023 ms
2022-03-10 07:28:36,554 [Import Entry - 9] DEBUG org.openbravo.dal.security.OrganizationStructureProvider - Client 39363B0921BB4293B48383844325E84C initialized in 0.455 ms
Performance
related to defect 0042370 closed AugustoMauch Unnecessary executions of a query that loads the complete organizational structure of a client 
Issue History
2022-03-10 07:29alostaleNew Issue
2022-03-10 07:29alostaleAssigned To => Triage Omni OMS
2022-03-10 07:29alostaleModules => Core
2022-03-10 07:29alostaleTriggers an Emergency Pack => No
2022-03-10 07:30alostaleTag Attached: Performance
2022-03-10 07:30alostaleRelationship addedrelated to 0042370
2022-03-10 07:34alostaleSummaryunnecesary OrganizationStructureProvider initialization on ticket creation => unnecesary OrganizationStructureProvider double initialization on ticket creation
2022-03-10 07:38hgbotNote Added: 0135608
2022-03-15 14:46hgbotResolutionopen => fixed
2022-03-15 14:46hgbotStatusnew => closed
2022-03-15 14:46hgbotNote Added: 0135735
2022-03-15 14:46hgbotFixed in Version => PR22Q2
2022-03-15 14:46hgbotNote Added: 0135736
2022-04-20 09:41plujanNote Added: 0136615
2022-04-20 09:41plujanAssigned ToTriage Omni OMS => alostale

Notes
(0135608)
hgbot   
2022-03-10 07:38   
Merge Request created: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/538 [^]
(0135735)
hgbot   
2022-03-15 14:46   
Merge request merged: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/538 [^]
(0135736)
hgbot   
2022-03-15 14:46   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/openbravo [^]
Changeset: 8a9b434def6ead92f787335bf2fa88e60d6d4fdd
Author: Asier Lostalé <asier.lostale@openbravo.com>
Date: 15-03-2022 13:45:00
URL: https://gitlab.com/openbravo/product/openbravo/-/commit/8a9b434def6ead92f787335bf2fa88e60d6d4fdd [^]

fixes BUG-48756: unnecesary OSP initialization in getDocumentType

Whenever FIN_Utility.getDocumentType was invoked, OSP was initialized.
In high volume environments, this causes a noticeable DB overhead in ticket
creation.

Instead of creating a new OSP instance which needs to be initialized, we
now reuse the one from the context that is already initialized.

---
M modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/utility/FIN_Utility.java
---
(0136615)
plujan   
2022-04-20 09:41   
Please change the generic user to the actual person assigned when fixing an issue