]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.db.impl/src/org/simantics/db/impl/graph/ReadGraphImpl.java
Multiple readers and variable optimization
[simantics/platform.git] / bundles / org.simantics.db.impl / src / org / simantics / db / impl / graph / ReadGraphImpl.java
index 25438ef1ef3f0d57878c32c3c03def4111c8ca0c..e3e7d50ecbc04998d62a650a9695ce939b6667ac 100644 (file)
@@ -45,6 +45,7 @@ import org.simantics.databoard.util.binary.BinaryFile;
 import org.simantics.databoard.util.binary.RandomAccessBinary;
 import org.simantics.db.AsyncReadGraph;
 import org.simantics.db.DevelopmentKeys;
+import org.simantics.db.ExternalValue;
 import org.simantics.db.ExternalValueSupport;
 import org.simantics.db.ReadGraph;
 import org.simantics.db.RelationContext;
@@ -6453,7 +6454,8 @@ public class ReadGraphImpl implements ReadGraph {
             for(Resource converter : graph.getObjects(resource, L0.ConvertsToValueWith)) {
                 try {
                        if(L0.Functions_functionApplication.equals(converter)) {
-                               return (Function3<ReadGraph,Resource,Object,T>)graph.syncRequest(new AdaptValue(resource));
+                               return AdaptValue.functionApplication;
+                               //return (Function3<ReadGraph,Resource,Object,T>)graph.syncRequest(new AdaptValue(resource));
                        } else {
                                return graph.getValue2(converter, resource);
                        }
@@ -6511,9 +6513,11 @@ public class ReadGraphImpl implements ReadGraph {
                }
        } else if(types.contains(L0.ExternalValue)) {
                try {
-                       return (T)ReflectionUtils.getValue(getURI(r)).getValue();
-               } catch(ValueNotFoundException e) {
-                       throw new DatabaseException(e);
+                       ExternalValue ev = adapt(r, ExternalValue.class);
+                       return ev.getValue(this, r);
+                       //return (T)ReflectionUtils.getValue(getURI(r)).getValue();
+//             } catch(ValueNotFoundException e) {
+//                     throw new DatabaseException(e);
                } catch(ClassCastException e) {
                        throw new DatabaseException(e);
                }