]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.db.procore/src/fi/vtt/simantics/procore/internal/SessionImplSocket.java
Some enhancements made by Antti for multiple readers
[simantics/platform.git] / bundles / org.simantics.db.procore / src / fi / vtt / simantics / procore / internal / SessionImplSocket.java
index c6942b5ed7b7972eb321c28f11fa5c4ec0be91b3..242fcfe3de8838867d4f7a8fe59ccdaa95eaa0ea 100644 (file)
@@ -90,6 +90,7 @@ import org.simantics.db.impl.internal.RandomAccessValueSupport;
 import org.simantics.db.impl.procedure.ResultCallWrappedQueryProcedure4;
 import org.simantics.db.impl.procedure.ResultCallWrappedSingleQueryProcedure4;
 import org.simantics.db.impl.query.QueryCache;
+import org.simantics.db.impl.query.QueryCacheBase;
 import org.simantics.db.impl.query.QueryProcessor;
 import org.simantics.db.impl.query.QueryProcessor.SessionRead;
 import org.simantics.db.impl.query.QueryProcessor.SessionTask;
@@ -1750,23 +1751,30 @@ public abstract class SessionImplSocket implements Session, WriteRequestSchedule
 
                     if (listener != null) {
 
-                        newGraph.processor.query(newGraph, request, null, new Procedure<T>() {
-
-                            @Override
-                            public void exception(Throwable t) {
-                                procedure.exception(t);
-                                if(throwable != null) {
-                                    throwable.set(t);
-                                }
-                            }
-
-                            @Override
-                            public void execute(T t) {
-                                if(result != null) result.set(t);
-                                procedure.execute(t);
-                            }
-
-                        }, listener);
+                        try {
+                            QueryCacheBase.resultExternalReadEntry(newGraph, request, null, listener, procedure);
+                        } catch (DatabaseException e) {
+                            Logger.defaultLogError(e);
+                        }
+                        
+                        
+//                        newGraph.processor.query(newGraph, request, null, new Procedure<T>() {
+//
+//                            @Override
+//                            public void exception(Throwable t) {
+//                                procedure.exception(t);
+//                                if(throwable != null) {
+//                                    throwable.set(t);
+//                                }
+//                            }
+//
+//                            @Override
+//                            public void execute(T t) {
+//                                if(result != null) result.set(t);
+//                                procedure.execute(t);
+//                            }
+//
+//                        }, listener);
 
 //                        newGraph.waitAsync(request);