X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.db.impl%2Fsrc%2Forg%2Fsimantics%2Fdb%2Fimpl%2Fquery%2FQueryCacheBase.java;h=6abaf6b6518e7b9239dad4830aa9acadd65492c5;hb=236aa4e765e0acd6e31cbc42dd9df9c2c23677e2;hp=d7a235fc813d4f302e719bb66647cd2cef972d91;hpb=277b1c7fb3fdd8effb4bf2b447358d0e4ef0e302;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.db.impl/src/org/simantics/db/impl/query/QueryCacheBase.java b/bundles/org.simantics.db.impl/src/org/simantics/db/impl/query/QueryCacheBase.java index d7a235fc8..6abaf6b65 100644 --- a/bundles/org.simantics.db.impl/src/org/simantics/db/impl/query/QueryCacheBase.java +++ b/bundles/org.simantics.db.impl/src/org/simantics/db/impl/query/QueryCacheBase.java @@ -189,71 +189,6 @@ public class QueryCacheBase { // // } - public Object performQuery(ReadGraphImpl parentGraph, final ExternalRead query, final CacheEntryBase entry_, AsyncProcedure procedure_) throws DatabaseException { - - ExternalReadEntry entry = (ExternalReadEntry)entry_; - AsyncProcedure procedure = (AsyncProcedure)procedure_; - - try { - - query.register(parentGraph, new Listener() { - - 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 Object performQuery(ReadGraphImpl parentGraph, final AsyncMultiRead query, final CacheEntryBase entry_, Object procedure_) throws DatabaseException {