]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/function/All.java
Cache PropertyInfoRequests in getStandardChildDomainPropertyVariables
[simantics/platform.git] / bundles / org.simantics.db.layer0 / src / org / simantics / db / layer0 / function / All.java
index 991a0500ce93dac89f4715fd301296b04d330863..4e775e08a22e12597044218f138aef3cfcaf6637 100644 (file)
@@ -38,13 +38,13 @@ import org.simantics.db.common.utils.Functions;
 import org.simantics.db.common.utils.ListUtils;
 import org.simantics.db.common.utils.Logger;
 import org.simantics.db.common.utils.NameUtils;
 import org.simantics.db.common.utils.ListUtils;
 import org.simantics.db.common.utils.Logger;
 import org.simantics.db.common.utils.NameUtils;
+import org.simantics.db.common.utils.NearestOwnerFinder;
 import org.simantics.db.common.validation.L0Validations;
 import org.simantics.db.exception.AdaptionException;
 import org.simantics.db.exception.DatabaseException;
 import org.simantics.db.exception.DoesNotContainValueException;
 import org.simantics.db.exception.NoSingleResultException;
 import org.simantics.db.exception.RuntimeDatabaseException;
 import org.simantics.db.common.validation.L0Validations;
 import org.simantics.db.exception.AdaptionException;
 import org.simantics.db.exception.DatabaseException;
 import org.simantics.db.exception.DoesNotContainValueException;
 import org.simantics.db.exception.NoSingleResultException;
 import org.simantics.db.exception.RuntimeDatabaseException;
-import org.simantics.db.exception.VariableException;
 import org.simantics.db.layer0.exception.InvalidVariableException;
 import org.simantics.db.layer0.exception.MissingVariableException;
 import org.simantics.db.layer0.exception.MissingVariableValueException;
 import org.simantics.db.layer0.exception.InvalidVariableException;
 import org.simantics.db.layer0.exception.MissingVariableException;
 import org.simantics.db.layer0.exception.MissingVariableValueException;
@@ -570,9 +570,9 @@ public class All {
             // Process graph properties
             for(Resource predicate : predicates) {
                
             // Process graph properties
             for(Resource predicate : predicates) {
                
-                       PropertyInfo info = graph.isImmutable(predicate) ?
-                                       graph.syncRequest(new PropertyInfoRequest(predicate), TransientCacheAsyncListener.<PropertyInfo>instance()) :
-                                               graph.syncRequest(new PropertyInfoRequest(predicate));
+                       PropertyInfo info = //graph.isImmutable(predicate) ?
+                                       graph.syncRequest(new PropertyInfoRequest(predicate), TransientCacheAsyncListener.<PropertyInfo>instance());// :
+                                               //graph.syncRequest(new PropertyInfoRequest(predicate));
 
                        if(!info.isHasProperty) continue;
                                        
 
                        if(!info.isHasProperty) continue;
                                        
@@ -992,7 +992,7 @@ public class All {
        
        public static PropertyInfo getPossiblePropertyInfoFromContext(ReadGraph graph, Variable variable, Resource context, String name) throws DatabaseException {
            if(context == null) return null;
        
        public static PropertyInfo getPossiblePropertyInfoFromContext(ReadGraph graph, Variable variable, Resource context, String name) throws DatabaseException {
            if(context == null) return null;
-               Map<String, PropertyInfo> predicates = graph.syncRequest(new UnescapedPropertyMapOfResource(context));
+               Map<String, PropertyInfo> predicates = graph.syncRequest(new UnescapedPropertyMapOfResource(context), TransientCacheListener.instance());
                return predicates.get(name);
        }
 
                return predicates.get(name);
        }
 
@@ -1504,7 +1504,7 @@ public class All {
         ClusteringSupport cs = graph.getService(ClusteringSupport.class);
         if(cs.isClusterSet(resource) && !base.equals(resource)) return resource;
         
         ClusteringSupport cs = graph.getService(ClusteringSupport.class);
         if(cs.isClusterSet(resource) && !base.equals(resource)) return resource;
         
-        Resource nearest = CommonDBUtils.getNearestOwner(graph, Collections.singletonList(resource));
+        Resource nearest = NearestOwnerFinder.getNearestOwner(graph, resource);
         if(nearest == null) return null;
         
         return getPossibleNearestClusterSet(graph, base, nearest);
         if(nearest == null) return null;
         
         return getPossibleNearestClusterSet(graph, base, nearest);