]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.db.procore/src/fi/vtt/simantics/procore/internal/SessionImplSocket.java
Cluster loading problem fix made by Antti
[simantics/platform.git] / bundles / org.simantics.db.procore / src / fi / vtt / simantics / procore / internal / SessionImplSocket.java
index c286f02c7d4434e69fe31fc0978ef057e16764d8..2ff47c29266912afa68ee0515fd5c47d1b809b89 100644 (file)
@@ -849,14 +849,17 @@ public abstract class SessionImplSocket implements Session, WriteRequestSchedule
         private void maintainCluster(ClusterImpl before, ClusterI after_) {
             if(after_ != null && after_ != before) {
                 ClusterImpl after = (ClusterImpl)after_;
-                if(currentCluster == before) currentCluster = after;
+                if(currentCluster == before) {
+                    currentCluster = after;
+                }
                 clusterTable.replaceCluster(after);
             }
         }
 
         public int createResourceKey(int foreignCounter) throws DatabaseException {
-            if(currentCluster == null)
+            if(currentCluster == null) {
                 currentCluster = getNewResourceCluster();
+            }
             if(currentCluster.getNumberOfResources(clusterTranslator) == ClusterTable.CLUSTER_FILL_SIZE) {
                 ClusterWriteOnly newCluster = (ClusterWriteOnly)getNewResourceCluster();
                 newCluster.foreignLookup = new byte[foreignCounter];