ref #6321 Load asynchronously loaded entities into main session
authorPatrick Plitzner <p.plitzner@bgbm.org>
Tue, 14 Aug 2018 18:32:02 +0000 (20:32 +0200)
committerPatrick Plitzner <p.plitzner@bgbm.org>
Tue, 14 Aug 2018 19:22:56 +0000 (21:22 +0200)
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/input/AbstractBulkEditorInput.java

index 51a806a531ab9b7530acdb46bdc0a81a02331237..503b8714b9feedef8e45af3a9f483d3054e51251 100644 (file)
@@ -208,8 +208,16 @@ public abstract class AbstractBulkEditorInput<T extends CdmBase> extends CdmEnti
                     }
                     configurator.setPageNumber(pageNumber);
                     entities = listEntities(configurator);
+                    /*
+                     * IMPORTANT!
+                     * Entities have to be loaded into the main session because they are
+                     * loaded in a parallel asynchronous thread
+                     */
+                    getCdmEntitySession().load(entities, true);
+
                     model.addAll(entities);
-                    //select if entity is loaded
+
+                    //select entity when it is loaded
                     if(selection!=null && model.containsAll(selection.toList())){
                         EventUtility.postAsyncEvent(WorkbenchEventConstants.BULK_EDITOR_SEARCH_FINISHED, selection);
                     }