PL-9438 CommitContext should preserve order of entities to guarantee reproducible behaviour on server side in case of errors

This commit is contained in:
Konstantin Krivopustov 2017-09-19 10:34:25 +04:00
parent d8e2499f3c
commit 60ff3f4845
2 changed files with 3 additions and 3 deletions

View File

@ -173,7 +173,7 @@ public class DataManagerBean implements DataManager {
cc.getViews().put(entity, view);
}
Set<Entity> result = new HashSet<>();
Set<Entity> result = new LinkedHashSet<>();
for (Map.Entry<String, CommitContext> entry : storeToContextMap.entrySet()) {
DataStore dataStore = storeFactory.get(entry.getKey());
Set<Entity> committed = dataStore.commit(entry.getValue());

View File

@ -31,8 +31,8 @@ public class CommitContext implements Serializable {
private static final long serialVersionUID = 2510011302544968537L;
protected Collection<Entity> commitInstances = new HashSet<>();
protected Collection<Entity> removeInstances = new HashSet<>();
protected Collection<Entity> commitInstances = new LinkedHashSet<>();
protected Collection<Entity> removeInstances = new LinkedHashSet<>();
protected Map<Object, View> views = new HashMap<>();