Openbravo Issue Tracking System - Retail Modules
View Issue Details
0034999Retail ModulesStoreServerpublic2017-01-18 15:432017-01-30 09:20
mtaal 
mtaal 
normalmajorhave not tried
closedfixed 
5
 
RR17Q2 
AugustoMauch
No
0034999: Do more caching and re-organize code in MobileServerProvider in the Replication Module
The MobileServerProvider class [1] provides the mobile servers and node-ids by client and organization to the symmetric ds routers.

This class can be improved in several ways:
- the synchronized block is not completely correct as the global member is set in the beginning of the initialization method [2], thereby defeating the check done in other code to determine if initialization needs to happen [3].
- node ids by client and organization can also be cached [4] and [5]

The code can be re-organized also to not call the original getters from the initialization code.

[1]
https://code.openbravo.com/erp/pmods/org.openbravo.replication.symmetricds/file/963ec1086228/src/org/openbravo/replication/symmetricds/util/MobileServerProvider.java [^]

[2]
https://code.openbravo.com/erp/pmods/org.openbravo.replication.symmetricds/file/963ec1086228/src/org/openbravo/replication/symmetricds/util/MobileServerProvider.java#l101 [^]

[3]
https://code.openbravo.com/erp/pmods/org.openbravo.replication.symmetricds/file/963ec1086228/src/org/openbravo/replication/symmetricds/util/MobileServerProvider.java#l81 [^]

[4]
https://code.openbravo.com/erp/pmods/org.openbravo.replication.symmetricds/file/963ec1086228/src/org/openbravo/replication/symmetricds/util/MobileServerProvider.java#l93 [^]

[5]
https://code.openbravo.com/erp/pmods/org.openbravo.replication.symmetricds/file/963ec1086228/src/org/openbravo/replication/symmetricds/util/MobileServerProvider.java#l177 [^]

See the current implementation of the MobileServerProvider
See the description
No tags attached.
has duplicate design defect 0033409 closed AugustoMauch Prevent race condition & improve initialization code in Mobile Server Key by org/client cache 
Issue History
2017-01-18 15:43mtaalNew Issue
2017-01-18 15:43mtaalAssigned To => mtaal
2017-01-18 15:43mtaalTriggers an Emergency Pack => No
2017-01-18 15:47mtaalReview Assigned To => AugustoMauch
2017-01-18 16:22hgbotCheckin
2017-01-18 16:22hgbotNote Added: 0093701
2017-01-18 16:22hgbotStatusnew => resolved
2017-01-18 16:22hgbotResolutionopen => fixed
2017-01-18 16:22hgbotFixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.replication.symmetricds/rev/f9af11aa6a4c90c3edc9cde15e8485850725dd87 [^]
2017-01-30 09:20AugustoMauchNote Added: 0093913
2017-01-30 09:20AugustoMauchStatusresolved => closed
2017-02-07 17:53AugustoMauchRelationship addedhas duplicate 0033409

Notes
(0093701)
hgbot   
2017-01-18 16:22   
Repository: erp/pmods/org.openbravo.replication.symmetricds
Changeset: f9af11aa6a4c90c3edc9cde15e8485850725dd87
Author: Martin Taal <martin.taal <at> openbravo.com>
Date: Wed Jan 18 16:21:53 2017 +0100
URL: http://code.openbravo.com/erp/pmods/org.openbravo.replication.symmetricds/rev/f9af11aa6a4c90c3edc9cde15e8485850725dd87 [^]

Fixes issue 34999: Do more caching and re-organize code in MobileServerProvider in the Replication Module

MobileServerEventHandler/MobileServerOrganizationEventHandler: set Property object in static member, call MobileServerProvider.resetInstance, this cache refresh is a but less precise mobile server definition/organization changes don't occur that much anyway

MobileServerProvider: cache the nodeIds, control synchronized block/methods using boolean members, simplify cache refresh by creating new instance of the method, reorganize the code so the initialization code does not call the original getter initiating the initialization.

---
M src/org/openbravo/replication/symmetricds/eventhandler/MobileServerEventHandler.java
M src/org/openbravo/replication/symmetricds/eventhandler/MobileServerOrganizationEventHandler.java
M src/org/openbravo/replication/symmetricds/util/MobileServerProvider.java
---
(0093913)
AugustoMauch   
2017-01-30 09:20   
Code reviewed and verified