]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.db.impl/src/org/simantics/db/impl/query/QueryCacheBase.java
Multiple simultaneous readers
[simantics/platform.git] / bundles / org.simantics.db.impl / src / org / simantics / db / impl / query / QueryCacheBase.java
index 4056f060b4f7fa6bfb54b74d0df474f63fa08191..e2737f891385911bdb321139dcd7b93a45ff518c 100644 (file)
@@ -100,64 +100,64 @@ public class QueryCacheBase {
                listeners = new THashMap<CacheEntry, ArrayList<ListenerEntry>>(10, 0.75f);
        }
        
-       public <T> Object performQuery(ReadGraphImpl parentGraph, final AsyncRead<T> query, final CacheEntryBase entry_, AsyncProcedure procedure_) throws DatabaseException {
-
-               AsyncReadEntry<T> entry = (AsyncReadEntry<T>)entry_;
-               AsyncProcedure<T> procedure = (AsyncProcedure<T>)procedure_;
-
-               ReadGraphImpl queryGraph = parentGraph.withParent(entry_);
-
-               try {
-                       
-                       query.perform(queryGraph, new AsyncProcedure<T>() {
-
-                               @Override
-                               public void execute(AsyncReadGraph returnGraph, T result) {
-                                       ReadGraphImpl impl = (ReadGraphImpl)returnGraph;
-                                       entry.addOrSet(parentGraph, result);
-                                       try {
-                                               procedure.execute(parentGraph, result);
-                                       } catch (Throwable t) {
-                                               t.printStackTrace();
-                                       }
-//                                     parentBarrier.dec(query);
-                               }
-
-                               @Override
-                               public void exception(AsyncReadGraph returnGraph, Throwable t) {
-                                       ReadGraphImpl impl = (ReadGraphImpl)returnGraph;
-//                                     AsyncReadGraph resumeGraph = finalParentGraph.newAsync();
-                                       entry.except(parentGraph, t);
-                                       try {
-                                               procedure.exception(parentGraph, t);
-                                       } catch (Throwable t2) {
-                                               t2.printStackTrace();
-                                       }
-//                                     parentBarrier.dec(query);
-                               }
-
-                               @Override
-                               public String toString() {
-                                       return procedure.toString();
-                               }
-
-                       });
-
-               } catch (Throwable t) {
-
-                       entry.except(t);
-                       try {
-                               procedure.exception(parentGraph, t);
-                       } catch (Throwable t2) {
-                               t2.printStackTrace();
-                       }
-//                     parentBarrier.dec(query);
-
-               }
-               
-               return null;
-               
-       }
+//     public <T> Object performQuery(ReadGraphImpl parentGraph, final AsyncRead<T> query, final CacheEntryBase entry_, AsyncProcedure procedure_) throws DatabaseException {
+//
+//             AsyncReadEntry<T> entry = (AsyncReadEntry<T>)entry_;
+//             AsyncProcedure<T> procedure = (AsyncProcedure<T>)procedure_;
+//
+//             ReadGraphImpl queryGraph = parentGraph.withParent(entry_);
+//
+//             try {
+//                     
+//                     query.perform(queryGraph, new AsyncProcedure<T>() {
+//
+//                             @Override
+//                             public void execute(AsyncReadGraph returnGraph, T result) {
+//                                     ReadGraphImpl impl = (ReadGraphImpl)returnGraph;
+//                                     entry.addOrSet(parentGraph, result);
+//                                     try {
+//                                             procedure.execute(parentGraph, result);
+//                                     } catch (Throwable t) {
+//                                             t.printStackTrace();
+//                                     }
+////                                   parentBarrier.dec(query);
+//                             }
+//
+//                             @Override
+//                             public void exception(AsyncReadGraph returnGraph, Throwable t) {
+//                                     ReadGraphImpl impl = (ReadGraphImpl)returnGraph;
+////                                   AsyncReadGraph resumeGraph = finalParentGraph.newAsync();
+//                                     entry.except(parentGraph, t);
+//                                     try {
+//                                             procedure.exception(parentGraph, t);
+//                                     } catch (Throwable t2) {
+//                                             t2.printStackTrace();
+//                                     }
+////                                   parentBarrier.dec(query);
+//                             }
+//
+//                             @Override
+//                             public String toString() {
+//                                     return procedure.toString();
+//                             }
+//
+//                     });
+//
+//             } catch (Throwable t) {
+//
+//                     entry.except(t);
+//                     try {
+//                             procedure.exception(parentGraph, t);
+//                     } catch (Throwable t2) {
+//                             t2.printStackTrace();
+//                     }
+////                   parentBarrier.dec(query);
+//
+//             }
+//             
+//             return null;
+//             
+//     }
 
 //     public <T> Object performQuery(ReadGraphImpl parentGraph, final Read<T> query, final CacheEntryBase entry_, AsyncProcedure procedure_) throws DatabaseException {
 //