]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.db.procore/src/org/simantics/db/procore/cluster/ClusterSmall.java
Some enhancements made by Antti for multiple readers
[simantics/platform.git] / bundles / org.simantics.db.procore / src / org / simantics / db / procore / cluster / ClusterSmall.java
index c8309c6bf5303a2909564de1a2f29637a8a34534..51818048f4f644c08714f29c8dab8b9feeff4dfa 100644 (file)
@@ -908,8 +908,11 @@ final public class ClusterSmall extends ClusterImpl {
         if (ClusterTraitsSmall.resourceRefIsLocal(resourceRef)) {
             key = clusterBits | resourceRef;
         } else {
-            foreignTable.fillResourceUID(ClusterTraitsSmall.resourceRefGetForeignIndex((short)resourceRef), this);
-            key = ClusterTraitsBase.createResourceKey(clusterSupport.getClusterKeyByClusterUIDOrMake(clusterUID1, clusterUID2), executeIndex);
+            // TODO: not so nice
+            synchronized(this) {
+                foreignTable.fillResourceUID(ClusterTraitsSmall.resourceRefGetForeignIndex((short)resourceRef), this);
+                key = ClusterTraitsBase.createResourceKey(clusterSupport.getClusterKeyByClusterUIDOrMake(clusterUID1, clusterUID2), executeIndex);
+            }
         }
         if (DEBUG)
             System.out.println("ClusterSmall.execute key=" + key);