Openbravo Issue Tracking System - Retail Modules
View Issue Details
0034516Retail ModulesWeb POSpublic2016-11-15 10:152016-12-22 14:36
caristu 
marvintm 
highmajoralways
closedfixed 
5
 
RR17Q1 
guilleaer
No
0034516: [clustering] associateMasterSlave in UpdateCashup is locked just at JVM level
The associateMasterSlave method invoked from getAndUpdateCashUp in UpdateCashup is a synchronized method. This means that the process has been designed to prevent its execution by different threads in parallel.

In a clustered environment the previous assumption is not guaranteed, as the synchronized method is preventing concurrent executions within the same JVM.

Therefore it could be possible to execute this process in parallel by different threads which belong to different nodes of a clustered environment.
In description
clustering
blocks design defect 0034490 acknowledged Triage Platform Base Openbravo ERP [clustering] Support clustering 
Issue History
2016-11-15 10:15caristuNew Issue
2016-11-15 10:15caristuAssigned To => Retail
2016-11-15 10:15caristuTriggers an Emergency Pack => No
2016-11-15 10:16caristuRelationship addedblocks 0034513
2016-11-15 10:16caristuRelationship deletedblocks 0034513
2016-11-15 10:16caristuRelationship addedblocks 0034490
2016-11-15 11:14caristuTag Attached: clustering
2016-11-17 11:51alostaleSeverityminor => major
2016-12-05 12:47hgbotCheckin
2016-12-05 12:47hgbotNote Added: 0092089
2016-12-05 12:47hgbotStatusnew => resolved
2016-12-05 12:47hgbotResolutionopen => fixed
2016-12-05 12:47hgbotFixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/ebb293ead59bc6ecc582b44eac54e0b8ae2711a2 [^]
2016-12-07 11:06hgbotCheckin
2016-12-07 11:06hgbotNote Added: 0092169
2016-12-09 12:53marvintmAssigned ToRetail => marvintm
2016-12-22 13:58hgbotCheckin
2016-12-22 13:58hgbotNote Added: 0092943
2016-12-22 14:36guilleaerReview Assigned To => guilleaer
2016-12-22 14:36guilleaerStatusresolved => closed
2016-12-22 14:36guilleaerFixed in Version => RR17Q1

Notes
(0092089)
hgbot   
2016-12-05 12:47   
Repository: erp/pmods/org.openbravo.retail.posterminal
Changeset: ebb293ead59bc6ecc582b44eac54e0b8ae2711a2
Author: Antonio Moreno <antonio.moreno <at> openbravo.com>
Date: Mon Dec 05 12:47:30 2016 +0100
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/ebb293ead59bc6ecc582b44eac54e0b8ae2711a2 [^]

Fixed issue 34516. Do not rely on synchronized flag to resolve potential race condition.
- When using shared payment methods, the cashups need to be associated forming a hierarchy. Before the change, to resolve potential race condition problems when master and slave terminals where logging in the system in parallel, the synchronized keyword was used. This ensured that cashups were generated sequentially, which ensured in turn that either master or slave cashups were found by the associating queries, and the hierarchy was always formed.
However, this doesn't work in an environment with clustering. To resolve this problem, the synchronized keyword has been removed, which means that now if terminals log at the same time, it is possible that cashups may be created and the hierarchy may still not be formed. However, this is not a problem, as the online requests which are done when the user accesses the Cashup window either in slave or in master terminals have also been modified, so that the association is formed at this point if it doesn't exist. This means that the hierarchy will always be formed when accessing the cashup window, even if it was not originally formed when logging in the system.

---
M src/org/openbravo/retail/posterminal/ProcessCashCloseMaster.java
M src/org/openbravo/retail/posterminal/ProcessCashCloseSlave.java
M src/org/openbravo/retail/posterminal/UpdateCashup.java
---
(0092169)
hgbot   
2016-12-07 11:06   
Repository: erp/pmods/org.openbravo.retail.posterminal
Changeset: 1e03d28480348c5f47398d8ac56f9d7dee22b5bd
Author: Antonio Moreno <antonio.moreno <at> openbravo.com>
Date: Wed Dec 07 11:05:58 2016 +0100
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/1e03d28480348c5f47398d8ac56f9d7dee22b5bd [^]

Related to issue 34516. Replace refresh by evict+get, to avoid potential performance issues. Force refresh also on master flow

---
M src/org/openbravo/retail/posterminal/ProcessCashCloseMaster.java
M src/org/openbravo/retail/posterminal/ProcessCashCloseSlave.java
---
(0092943)
hgbot   
2016-12-22 13:58   
Repository: erp/pmods/org.openbravo.retail.posterminal
Changeset: 9e336a10baa509104e596c9dd27ccee07fce84b5
Author: Antonio Moreno <antonio.moreno <at> openbravo.com>
Date: Thu Dec 22 13:58:06 2016 +0100
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/9e336a10baa509104e596c9dd27ccee07fce84b5 [^]

Related to issue 34516. Remove unnecessary refresh. Use already existing variable.

---
M src/org/openbravo/retail/posterminal/ProcessCashCloseMaster.java
M src/org/openbravo/retail/posterminal/ProcessCashCloseSlave.java
---