Openbravo Issue Tracking System - Retail Modules
View Issue Details
0035470Retail ModulesStoreServerpublic2017-03-09 16:482017-03-18 11:49
mtaal 
AugustoMauch 
normalminorhave not tried
closedfixed 
5
 
RR17Q2 
mtaal
No
0035470: Code should not adapt the Map instance it gets from a method, but instead call the originating class to adapt the Map
See the code here [1], it gets a Map instance from the SynchronizationEngineProvider.getChannelsWithInitialLoadInProgress() method and changes the Map instance. This works as the Map instance is the same as being kept internally in the SynchronizationEngineProvider. But it is less nice from a encapsulation point of view to adapt the map outside of its owner (the SynchronizationEngineProvider).

[1]
https://code.openbravo.com/erp/pmods/org.openbravo.replication.symmetricds/rev/5f4547f93c1a9a8ba8add123b198ec084e8ff95e#l4.42 [^]
See description
Better to either call the setter again (makes no difference in the logic really but shows that the resulting map is set back, ignoring multi-threading issues).

But nicest probably to have a removeChannel method on the SynchronizationEngineProvider to remove a channel from the internal Map.
No tags attached.
blocks feature request 0034835 closed AugustoMauch Use another approach for the Table Reload process 
Issue History
2017-03-09 16:48mtaalNew Issue
2017-03-09 16:48mtaalAssigned To => AugustoMauch
2017-03-09 16:48mtaalTriggers an Emergency Pack => No
2017-03-09 16:49mtaalRelationship addedblocks 0034835
2017-03-10 09:14hgbotCheckin
2017-03-10 09:14hgbotNote Added: 0094894
2017-03-10 09:14hgbotStatusnew => resolved
2017-03-10 09:14hgbotResolutionopen => fixed
2017-03-10 09:14hgbotFixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.replication.symmetricds/rev/7416d6418ced0a003624169ee3c0f7e12f7a14e0 [^]
2017-03-18 11:48mtaalReview Assigned To => mtaal
2017-03-18 11:48mtaalProposed Solution updated
2017-03-18 11:49mtaalNote Added: 0095383
2017-03-18 11:49mtaalStatusresolved => closed

Notes
(0094894)
hgbot   
2017-03-10 09:14   
Repository: erp/pmods/org.openbravo.replication.symmetricds
Changeset: 7416d6418ced0a003624169ee3c0f7e12f7a14e0
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Fri Mar 10 09:14:09 2017 +0100
URL: http://code.openbravo.com/erp/pmods/org.openbravo.replication.symmetricds/rev/7416d6418ced0a003624169ee3c0f7e12f7a14e0 [^]

Fixes issue 35470: Improves encapsulation in server Initial Data Load process

The SynchronizationEngineProvider class keeps a Map to manage the channels whose initial data load is not finished. Before this changeset, this Map was shared with other classes, that r
ead it and modified. Now the map is not shared, and some methods to modify the map have been added to SynchronizationEngineProvider to improve the encapsulation.

---
M src/org/openbravo/replication/symmetricds/SynchronizationEngineProvider.java
M src/org/openbravo/replication/symmetricds/extensions/BatchDatabaseWriterControl.java
---
(0095383)
mtaal   
2017-03-18 11:49   
Reviewed and tested