Openbravo Issue Tracking System - Retail Modules
View Issue Details
0037728Retail ModulesWeb POSpublic2018-01-25 13:452018-03-28 00:41
marvintm 
rqueralta 
normalmajorhave not tried
newopen 
5
 
 
No
0037728: Concurrent modification of business partners and business partner addresses is not correctly handled
Currently concurrent modification of business partners is not properly handled in the Web POS, because no locking mechanism is used. Optimistic locking should be used similarly to how it is currently handled in the layaways flow.
.
No tags attached.
Issue History
2018-01-25 13:45marvintmNew Issue
2018-01-25 13:45marvintmAssigned To => Retail
2018-01-25 13:45marvintmTriggers an Emergency Pack => No
2018-01-25 14:01marvintmSummaryConcurrent modification of business partners is not correctly handled => Concurrent modification of business partners and business partner addresses is not correctly handled
2018-02-07 15:19hgbotCheckin
2018-02-07 15:19hgbotNote Added: 0102254
2018-02-07 15:19hgbotStatusnew => resolved
2018-02-07 15:19hgbotResolutionopen => fixed
2018-02-07 15:19hgbotFixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/9565ddc5afda196009d6aa0ae47e97059252a3f7 [^]
2018-02-07 16:54hgbotCheckin
2018-02-07 16:54hgbotNote Added: 0102259
2018-02-07 17:32marvintmAssigned ToRetail => alekosmp86
2018-02-15 18:18marvintmNote Added: 0102451
2018-02-15 18:18marvintmStatusresolved => new
2018-02-15 18:18marvintmResolutionfixed => open
2018-02-19 16:24hgbotCheckin
2018-02-19 16:25hgbotNote Added: 0102493
2018-02-19 16:25hgbotStatusnew => resolved
2018-02-19 16:25hgbotResolutionopen => fixed
2018-02-19 16:25hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/9565ddc5afda196009d6aa0ae47e97059252a3f7 [^] => http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/6873765f8764bfe3c1aca2e45149060db287c1fb [^]
2018-02-28 18:09marvintmNote Added: 0102876
2018-02-28 18:09marvintmStatusresolved => new
2018-02-28 18:09marvintmResolutionfixed => open
2018-03-12 14:14hgbotCheckin
2018-03-12 14:14hgbotNote Added: 0103162
2018-03-16 14:39marvintmAssigned Toalekosmp86 => rqueralta
2018-03-19 08:22marvintmStatusnew => scheduled
2018-03-19 08:22marvintmStatusscheduled => resolved
2018-03-19 08:22marvintmFixed in Version => RR18Q2
2018-03-19 08:22marvintmResolutionopen => fixed
2018-03-27 22:58marvintmNote Added: 0103590
2018-03-27 22:58marvintmStatusresolved => new
2018-03-27 22:58marvintmResolutionfixed => open
2018-03-27 22:58marvintmFixed in VersionRR18Q2 =>
2018-03-28 00:41hgbotCheckin
2018-03-28 00:41hgbotNote Added: 0103591

Notes
(0102254)
hgbot   
2018-02-07 15:19   
Repository: erp/pmods/org.openbravo.retail.posterminal
Changeset: 9565ddc5afda196009d6aa0ae47e97059252a3f7
Author: Alejandro <alekosmp86 <at> gmail.com>
Date: Wed Jan 31 09:38:08 2018 -0500
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/9565ddc5afda196009d6aa0ae47e97059252a3f7 [^]

Fixes issue 37728: Concurrent modification of Customer's data is now properly handled

---
M src/org/openbravo/retail/posterminal/CustomerAddrLoader.java
M src/org/openbravo/retail/posterminal/CustomerLoader.java
M web/org.openbravo.retail.posterminal/js/pointofsale/view/subwindows/customeraddress/customeraddrdetailview.js
M web/org.openbravo.retail.posterminal/js/pointofsale/view/subwindows/customeraddress/editcreatecustomeraddress.js
M web/org.openbravo.retail.posterminal/js/pointofsale/view/subwindows/customers/customerdetailview.js
M web/org.openbravo.retail.posterminal/js/pointofsale/view/subwindows/customers/editcreatecustomerform.js
---
(0102259)
hgbot   
2018-02-07 16:54   
Repository: erp/pmods/org.openbravo.retail.posterminal
Changeset: 616918a791520516982cd81dddd65c797834f963
Author: Alejandro <alekosmp86 <at> gmail.com>
Date: Wed Feb 07 10:53:18 2018 -0500
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/616918a791520516982cd81dddd65c797834f963 [^]

Related to issue 37728: Concurrent modification of Customer's data is now
properly handled

Backed out changeset: 9565ddc5afda

---
M src/org/openbravo/retail/posterminal/CustomerAddrLoader.java
M src/org/openbravo/retail/posterminal/CustomerLoader.java
M web/org.openbravo.retail.posterminal/js/pointofsale/view/subwindows/customeraddress/customeraddrdetailview.js
M web/org.openbravo.retail.posterminal/js/pointofsale/view/subwindows/customeraddress/editcreatecustomeraddress.js
M web/org.openbravo.retail.posterminal/js/pointofsale/view/subwindows/customers/customerdetailview.js
M web/org.openbravo.retail.posterminal/js/pointofsale/view/subwindows/customers/editcreatecustomerform.js
---
(0102451)
marvintm   
2018-02-15 18:18   
After further discussion, the main changes we need to do are:
- Ensure that in BusinessPartnerProperties.java the "loaded" property corresponds to the "updated" property of the business partner
- In CustomerLoader the changes done to throw the OutDatedDataChangeException make sense and should be included in the fix.
(0102493)
hgbot   
2018-02-19 16:24   
Repository: erp/pmods/org.openbravo.retail.posterminal
Changeset: 6873765f8764bfe3c1aca2e45149060db287c1fb
Author: Alejandro <alekosmp86 <at> gmail.com>
Date: Wed Jan 31 09:38:08 2018 -0500
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/6873765f8764bfe3c1aca2e45149060db287c1fb [^]

Fixes issue 37728: Concurrent modification of Customer's data is now properly handled

---
M src/org/openbravo/retail/posterminal/CustomerAddrLoader.java
M src/org/openbravo/retail/posterminal/CustomerLoader.java
M src/org/openbravo/retail/posterminal/master/BusinessPartnerProperties.java
M web/org.openbravo.retail.posterminal/js/pointofsale/view/subwindows/customeraddress/customeraddrdetailview.js
M web/org.openbravo.retail.posterminal/js/pointofsale/view/subwindows/customeraddress/editcreatecustomeraddress.js
M web/org.openbravo.retail.posterminal/js/pointofsale/view/subwindows/customers/customerdetailview.js
M web/org.openbravo.retail.posterminal/js/pointofsale/view/subwindows/customers/editcreatecustomerform.js
---
(0102876)
marvintm   
2018-02-28 18:09   
Still not working completely right. It is possible to modify concurrently the same customer from two different terminals:
- Connect to terminal VBS-1 from two different browsers.
- Open customer "Arturo Montero" from both browsers.
- Modify it in both browsers, and synchronise it.
No error will appear.

I think the main reason this is happening is that the "loaded" property is being modified in the client side, and its set to the current date. I believe this change was done to prevent two subsequent modifications in the same terminal from failing (because the second one would have an outdated loaded, and would fail with concurrent modification).

I understand then why this was done, but a small change is then needed: we should ensure that the "loaded" property which is synchronised to the backend is the previous one, and only then should the "loaded" property be modified in the client side. This would handle the case of two subsequent modifications in one terminal correctly, and would also handle correctly (in this case, fail) in case of two concurrent modifications in two different terminals.
(0103162)
hgbot   
2018-03-12 14:14   
Repository: erp/pmods/org.openbravo.retail.posterminal
Changeset: 764d263898f7558d6a9d64c705945220d4c4c61d
Author: Rafael Queralta Pozo <rqueralta <at> nauta.cu>
Date: Thu Mar 08 15:04:51 2018 -0500
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/764d263898f7558d6a9d64c705945220d4c4c61d [^]

Related to issue 37728: Concurrent modification of Customer's data is now
properly handled

---
M web/org.openbravo.retail.posterminal/js/pointofsale/view/subwindows/customers/components/sharedcomponents.js
M web/org.openbravo.retail.posterminal/js/pointofsale/view/subwindows/customers/customerdetailview.js
M web/org.openbravo.retail.posterminal/js/pointofsale/view/subwindows/customers/editcreatecustomerform.js
---
(0103590)
marvintm   
2018-03-27 22:58   
Current implementation doesn't completely solve all the cases, and has clear issues with the normal WebPOS synchronization mode, and offline mode. Changes will be reverted, and the solution will be rethought during the next release.
(0103591)
hgbot   
2018-03-28 00:41   
Repository: erp/pmods/org.openbravo.retail.posterminal
Changeset: 5348d4e8468ad80a86af03633b1ab88a370a89f6
Author: Rafael Queralta Pozo <rqueralta <at> nauta.cu>
Date: Tue Mar 27 18:15:39 2018 -0400
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/5348d4e8468ad80a86af03633b1ab88a370a89f6 [^]

Related to issue 37728: Concurrent modification of Customer's data is now
properly handled

 - Backed out changeset: 764d263898f7
 - Backed out changeset: 6873765f8764
 - Backed out changeset: 616918a79152
 - Backed out changeset: 9565ddc5afda

---
M src/org/openbravo/retail/posterminal/CustomerAddrLoader.java
M src/org/openbravo/retail/posterminal/CustomerLoader.java
M src/org/openbravo/retail/posterminal/master/BusinessPartnerProperties.java
M web/org.openbravo.retail.posterminal/js/pointofsale/view/subwindows/customeraddress/customeraddrdetailview.js
M web/org.openbravo.retail.posterminal/js/pointofsale/view/subwindows/customeraddress/editcreatecustomeraddress.js
M web/org.openbravo.retail.posterminal/js/pointofsale/view/subwindows/customers/components/sharedcomponents.js
---