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.QueryProcessor;
import org.simantics.db.impl.query.QueryProcessor.SessionRead;
import org.simantics.db.impl.query.QueryProcessor.SessionTask;
}
- assert(!queryProvider2.dirty);
+ assert(!queryProvider2.cache.dirty);
} catch (Throwable e) {
if (listener != null) {
try {
- newGraph.processor.queryRead(newGraph, request, null, new AsyncProcedure<T>() {
+
+ AsyncProcedure ap = new AsyncProcedure<T>() {
@Override
public void exception(AsyncReadGraph graph, Throwable t) {
procedure.execute(graph, t);
}
- }, listener);
+ };
+
+ QueryCache.runnerReadEntry(newGraph, request, null, listener, ap);
+
} catch (Throwable t) {
// This is handled by the AsyncProcedure
//Logger.defaultLogError("Internal error", t);
if (listener != null) {
- newGraph.processor.query(newGraph, request, null, procedure, listener);
-
-// newGraph.waitAsync(request);
+ try {
+ QueryCache.runnerAsyncReadEntry(newGraph, request, null, listener, procedure);
+ //newGraph.processor.query(newGraph, request, null, procedure, listener);
+ } catch (DatabaseException e) {
+ Logger.defaultLogError(e);
+ }
} else {
public int getAmountOfQueryThreads() {
// This must be a power of two
- return 1;
+ return 4;
// return Integer.highestOneBit(Runtime.getRuntime().availableProcessors());
}