]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.db.impl/src/org/simantics/db/impl/query/QueryCacheBase.java
Fixes based on feedback
[simantics/platform.git] / bundles / org.simantics.db.impl / src / org / simantics / db / impl / query / QueryCacheBase.java
index d7a235fc813d4f302e719bb66647cd2cef972d91..6abaf6b6518e7b9239dad4830aa9acadd65492c5 100644 (file)
@@ -189,71 +189,6 @@ public class QueryCacheBase {
 //             
 //     }
 
-       public <T> Object performQuery(ReadGraphImpl parentGraph, final ExternalRead<T> query, final CacheEntryBase entry_, AsyncProcedure procedure_) throws DatabaseException {
-
-               ExternalReadEntry entry = (ExternalReadEntry)entry_;
-               AsyncProcedure<T> procedure = (AsyncProcedure<T>)procedure_;
-               
-               try {
-
-                       query.register(parentGraph, new Listener<T>() {
-
-                               AtomicBoolean used = new AtomicBoolean(false);
-
-                               @Override
-                               public void execute(T result) {
-
-                                       // Just for safety
-                                       if(entry.isDiscarded()) return;
-
-                                       if(used.compareAndSet(false, true)) {
-                                               //entry.setPending();
-                                               entry.addOrSet(parentGraph.processor, result);
-                                               procedure.execute(parentGraph, result);
-                                       } else {
-                                               entry.queue(result);
-                                               parentGraph.processor.updatePrimitive(query);
-                                       }
-
-                               }
-
-                               @Override
-                               public void exception(Throwable t) {
-
-                                       entry.except(t);
-
-                                       if(used.compareAndSet(false, true)) {
-                                               procedure.exception(parentGraph, t);
-                                       } else {
-//                                             entry.queue(result);
-                                               parentGraph.processor.updatePrimitive(query);
-                                       }
-
-                               }
-
-                               @Override
-                               public String toString() {
-                                       return procedure.toString();
-                               }
-
-                               @Override
-                               public boolean isDisposed() {
-                                       return entry.isDiscarded() || !parentGraph.processor.isBound(entry);
-                               }
-
-                       });
-
-                       return entry.getResult();
-
-               } catch (Throwable t) {
-
-                       entry.except(t);
-                       procedure.exception(parentGraph, t);
-                       return entry.getResult();
-
-               }
-
-       }
 
        public <T> Object performQuery(ReadGraphImpl parentGraph, final AsyncMultiRead<T> query, final CacheEntryBase entry_, Object procedure_) throws DatabaseException {