Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0034201Openbravo ERPA. Platformpublic2016-10-13 15:052017-05-25 09:27
alostale 
alostale 
urgentmajorhave not tried
closedfixed 
5
 
3.0PR17Q13.0PR17Q1 
caristu
Core
No
0034201: can't create import entries while changing role organization access
Modifying any role's organization access (edit/add/remove) creates contention on import entry, so any new entry created while the transaction doing the modifications is queued till it finishes.

This is much more noticeable the bigger the number of roles is in the system.
1. In an instance with several roles edit any one to grant access to any new organization
2. Meanwhile, create an order from WebPOS

  -> Realize the import entry to process that order is not created until the role edition has been completed.
The root cause of the problem is in AD_ROLE_ORGACCESS_TRG: (SELECT * FROM AD_Role FOR UPDATE) [1]. Because import entry has a FK to ad_role, insertions require the transaction to be completed in order the lock to be released.

The purpose of this trigger is to update client and org lists in ad_role, but note those two fields are deprecated since 2010 and they are not currently in use. See issue 0014750

So the proposed solution is to completely remove those columns and the trigger.

--
[1] https://code.openbravo.com/erp/devel/pi/file/0d765967dc06/src-db/database/model/triggers/AD_ROLE_ORGACCESS_TRG.xml#l46 [^]
Performance
related to defect 00147502.50MP23 closed adrianromero I can not access to the application when there are many organizations. 
depends on defect 0034297 closed alostale api change: removed CLIENTLIST and ORGLIST from AD_ROLE 
related to defect 0035333 closed vmromanos Build error in RR17Q1 with latest Improved Balance Sheet and P&L Structure Report version (1.0.0) 
causes defect 0036092 closed alostale Failed to apply roles dataset 
? 34201.export (22,601) 2016-10-13 15:20
https://issues.openbravo.com/file_download.php?file_id=9908&type=bug
Issue History
2016-10-13 15:05alostaleNew Issue
2016-10-13 15:05alostaleAssigned To => platform
2016-10-13 15:05alostaleModules => Core
2016-10-13 15:05alostaleTriggers an Emergency Pack => No
2016-10-13 15:07alostaleRelationship addedrelated to 0014750
2016-10-13 15:12alostaleProposed Solution updated
2016-10-13 15:13alostaleStatusnew => scheduled
2016-10-13 15:20alostaleFile Added: 34201.export
2016-10-13 15:20alostaleReview Assigned To => caristu
2016-10-26 13:01alostaleRelationship addeddepends on 0034297
2016-10-26 13:02hgbotCheckin
2016-10-26 13:02hgbotNote Added: 0090921
2016-10-26 13:02hgbotStatusscheduled => resolved
2016-10-26 13:02hgbotResolutionopen => fixed
2016-10-26 13:02hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/02c7d99b53e94e81945da798a3130bb2a0aa192f [^]
2016-11-04 15:09caristuNote Added: 0091180
2016-11-04 15:09caristuStatusresolved => closed
2016-11-04 15:09caristuFixed in Version => 3.0PR17Q1
2016-12-16 18:38hudsonbotCheckin
2016-12-16 18:38hudsonbotNote Added: 0092579
2016-12-23 07:53alostaleAssigned Toplatform => alostale
2017-02-22 08:17alostaleRelationship addedrelated to 0035333
2017-05-25 09:27alostaleTag Attached: Performance
2017-05-25 09:27alostaleRelationship addedcauses 0036092

Notes
(0090921)
hgbot   
2016-10-26 13:02   
Repository: erp/devel/pi
Changeset: 02c7d99b53e94e81945da798a3130bb2a0aa192f
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Wed Sep 21 16:39:13 2016 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/02c7d99b53e94e81945da798a3130bb2a0aa192f [^]

fixed bug 34201: can't create import entries while changing role org access

  Removed deprecated client and org list in ad_role because the trigger that kept
  them in sync was craeting contention for insertions into import entry.

---
M src-db/database/model/tables/AD_ROLE.xml
M src-db/database/sourcedata/AD_COLUMN.xml
M src-db/database/sourcedata/AD_ELEMENT.xml
M src-db/database/sourcedata/AD_FIELD.xml
M src-test/src/org/openbravo/test/dal/IssuesTest.java
M src-test/src/org/openbravo/test/datasource/DataSourceSecurity.java
M src-test/src/org/openbravo/test/role/inheritance/RoleInheritanceTestUtils.java
M src-test/src/org/openbravo/test/security/ExplicitCrossOrganizationReference.java
M src/org/openbravo/erpCommon/businessUtility/InitialSetupUtility.java
R src-db/database/model/triggers/AD_ROLE_ORGACCESS_TRG.xml
---
(0091180)
caristu   
2016-11-04 15:09   
Reviewed
(0092579)
hudsonbot   
2016-12-16 18:38   
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/dc8bf00badd0 [^]
Maturity status: Test