ref #9078 improve UpdateResult handling in CdmTransientEntityCacher
authorAndreas Müller <a.mueller@bgbm.org>
Wed, 24 Jun 2020 21:47:22 +0000 (23:47 +0200)
committerAndreas Müller <a.mueller@bgbm.org>
Wed, 24 Jun 2020 21:48:12 +0000 (23:48 +0200)
-  include result entity to the updated objects
- load updated objects also if they their ID does not yet exist in Cacher (this is needed to always call recursive updating)

eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/remoting/cache/ConversationalTransientEntityCacher.java

index b21885a6c48074e7673eaba606424cb43f702f66..ac25be920ad38383ec93e1a3f84be171b5dd8b9b 100755 (executable)
@@ -36,6 +36,7 @@ public class ConversationalTransientEntityCacher extends CdmTransientEntityCache
         // probably a good time to broadcast to other sessions
 
         Set<CdmBase> updatedObjects = result.getUpdatedObjects();
+        updatedObjects.add(result.getCdmEntity());
         Set<CdmBase> reloadedObjects = new HashSet<>();
         Set<CdmEntityIdentifier> updatedCdmIds = result.getUpdatedCdmIds();
         boolean updatedCdmIdsIsEmpty = updatedCdmIds.isEmpty();
@@ -48,8 +49,8 @@ public class ConversationalTransientEntityCacher extends CdmTransientEntityCache
                 if(!updatedCdmIdsIsEmpty && updatedCdmIds.contains(cdmEntityIdentifier)) {
                     updatedCdmIds.remove(cdmEntityIdentifier);
                 }
-                reloadedObjects.add(load(updatedObject, update));
             }
+            reloadedObjects.add(load(updatedObject, update));
         }
 
         // remote load cdm identifiers of objects which already exist