]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.db/src/org/simantics/db/service/QueryControl.java
AsyncBarrier.dec runs into refcounting problem
[simantics/platform.git] / bundles / org.simantics.db / src / org / simantics / db / service / QueryControl.java
index 3da3c5aa3baa8f71e50bb1615939dcc8ef8a7fae..a8c7286437aa4b1d08c619926a05b8d986eec5b0 100644 (file)
@@ -17,9 +17,11 @@ import org.simantics.db.AsyncReadGraph;
 import org.simantics.db.ReadGraph;
 import org.simantics.db.Resource;
 import org.simantics.db.WriteGraph;
+import org.simantics.db.exception.DatabaseException;
 import org.simantics.db.procedure.AsyncContextMultiProcedure;
 import org.simantics.db.procedure.AsyncMultiProcedure;
 import org.simantics.db.request.ExternalRead;
+import org.simantics.db.request.Read;
 
 
 /**
@@ -87,12 +89,25 @@ public interface QueryControl {
      * performed with the specified ReadGraph. DB listeners are therefore not
      * triggered by anything that is performed with the returned ReadGraph.
      * 
+     * @Deprecated In favor of syncRequestIndependent 
      * @param graph read transaction handle to clone for listener-independent
      *        use
      * @return read transaction handle that is independent of the requests
      *         performed with the parameter
      */
     ReadGraph getIndependentGraph(ReadGraph graph);
+    
+    /**
+     * Performs the given request without accumulating query dependencies.
+     * DB listeners are therefore not triggered by anything that is performed within the request.
+     * 
+     * @param graph read transaction handle to clone for listener-independent
+     *        use
+     * @param request the request to perform
+     * @return the result of the request evaluation
+     */
+    <T> T syncRequestIndependent(ReadGraph graph, Read<T> request) throws DatabaseException;
+    
     boolean hasParentRequest(ReadGraph graph);
 
 }