Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0035674Openbravo ERPA. Platformpublic2017-04-03 11:012017-05-29 17:43
maite 
inigosanchez 
urgentmajoralways
closedfixed 
5
 
3.0PR17Q3 
alostale
Core
No
0035674: Concurrency problems applying datasets
Dataset information is duplicated in case 2 different users apply it at the same time
1. Install the Spanish Professional Localization Pack [1].
2. Go to modules folder, delete and clone this module [2]. Ensures that version 4.1.600 of the module is applied.
3. Login in the ERP as F&B International Admin role.
4. Go to Enterprise Module Management and apply "taxes" dataset: Taxes: configuration for Spain (Impuestos de EspaƱa) 1.2.202.
5. Ensure that 2 users access to Enterprise Module Management window, each user using their browser, both select "347" dataset and run process at the same time.
6. Both user will receive succesfull message. In fact, dataset is applied twice (see ad_orgmodule). Note that if you access to "Tax Report" window you will find duplicated data.

[1].- http://centralrepository.openbravo.com/openbravo/org.openbravo.forge.ui/sso/ForgeModuleDetail/Professional-Localization-Pack-Spain-Espana-Cash-VAT [^]
[2].- http://centralrepository.openbravo.com/openbravo/org.openbravo.forge.ui/ForgeModuleDetail/Spain-AEAT-Modelo-347-For-APR [^]
No tags attached.
depends on defect 0035970 closed inigosanchez API changes related with added a unique constraint in ad_orgmodule 
Issue History
2017-04-03 11:01maiteNew Issue
2017-04-03 11:01maiteAssigned To => platform
2017-04-03 11:01maiteModules => Core
2017-04-03 11:01maiteResolution time => 1492639200
2017-04-03 11:01maiteTriggers an Emergency Pack => No
2017-04-03 11:01maiteIssue Monitored: networkb
2017-04-07 09:05alostaleStatusnew => acknowledged
2017-04-24 09:23inigosanchezStatusacknowledged => scheduled
2017-04-24 09:23inigosanchezAssigned Toplatform => inigosanchez
2017-04-26 16:15inigosanchezSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=15061#r15061
2017-05-10 15:16inigosanchezRelationship addedrelated to 0035970
2017-05-10 15:18inigosanchezRelationship deletedrelated to 0035970
2017-05-10 15:18inigosanchezRelationship addeddepends on 0035970
2017-05-10 16:25hgbotCheckin
2017-05-10 16:25hgbotNote Added: 0096515
2017-05-10 16:25hgbotStatusscheduled => resolved
2017-05-10 16:25hgbotResolutionopen => fixed
2017-05-10 16:25hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/a6134d0fa858c5ea1af4619d506d399dae8e8262 [^]
2017-05-10 16:28inigosanchezNote Added: 0096516
2017-05-10 16:28inigosanchezReview Assigned To => alostale
2017-05-11 09:21alostaleNote Added: 0096523
2017-05-11 09:21alostaleStatusresolved => closed
2017-05-11 09:21alostaleFixed in Version => 3.0PR17Q3
2017-05-29 17:43hudsonbotCheckin
2017-05-29 17:43hudsonbotNote Added: 0096955

Notes
(0096515)
hgbot   
2017-05-10 16:25   
Repository: erp/devel/pi
Changeset: a6134d0fa858c5ea1af4619d506d399dae8e8262
Author: Inigo Sanchez <inigo.sanchez <at> openbravo.com>
Date: Wed May 10 16:23:40 2017 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/a6134d0fa858c5ea1af4619d506d399dae8e8262 [^]

Fixed issue 35674: Concurrency problems applying datasets

The problem occured applying the same dataset (at the same time) for the same client,
organization and version. This problem is not reproduced always. It is a concurrency
problem not managed properly.

In order to resolved this problem two diferent actions have been done:
- Added a unique constraint in ad_orgmodule in order to prevent duplicated data for the
same client, org, module and version. This table is used to check when a dataset is
applied. Besides a BuildValidation is added in order to prevent an error when the unique
constraint applied.
- The same connection is used when applying datasets in order to ensures that all the
modifications in the database are done in the same transaction. Besides some checks has
been improvement.

Now the problem has been fixed by take into account concurrency problems properly.

---
M src-db/database/model/tables/AD_ORGMODULE.xml
M src-db/database/sourcedata/AD_MESSAGE.xml
M src/org/openbravo/erpCommon/ad_forms/UpdateReferenceData.java
M src/org/openbravo/erpCommon/ad_forms/UpdateReferenceData_data.xsql
A src-util/buildvalidation/build/classes/org/openbravo/buildvalidation/DuplicatedOrgModuleDatasets.class
A src-util/buildvalidation/build/classes/org/openbravo/buildvalidation/DuplicatedOrgModuleDatasetsData.class
A src-util/buildvalidation/src/org/openbravo/buildvalidation/DuplicatedOrgModuleDatasets.java
A src-util/buildvalidation/src/org/openbravo/buildvalidation/DuplicatedOrgModuleDatasets_data.xsql
---
(0096516)
inigosanchez   
2017-05-10 16:28   
If new build validation fails this info [1] is referenced.

[1]. http://wiki.openbravo.com/wiki/Duplicated_Data_Into_AD_ORGMODULE [^]
(0096523)
alostale   
2017-05-11 09:21   
code reviewed

didn't find any case where dataset can be applied more than once
(0096955)
hudsonbot   
2017-05-29 17:43   
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/1ee70113bdc4 [^]
Maturity status: Test