import org.simantics.db.AsyncReadGraph;
import org.simantics.db.exception.DatabaseException;
-import org.simantics.db.exception.RuntimeDatabaseException;
import org.simantics.db.impl.BlockingAsyncProcedure;
import org.simantics.db.impl.DebugPolicy;
import org.simantics.db.impl.graph.AsyncBarrierImpl;
try {
- BlockingAsyncProcedure<T> proc = new BlockingAsyncProcedure<>(graph, new AsyncProcedure<T>() {
+ BlockingAsyncProcedure<T> proc = new BlockingAsyncProcedure<>(graph.asyncBarrier, graph, new AsyncProcedure<T>() {
@Override
public void execute(AsyncReadGraph graph, T result) {
ReadGraphImpl queryGraph = graph.withParent(entry);
- BlockingAsyncProcedure<T> proc = new BlockingAsyncProcedure<>(queryGraph, null, request);
+ BlockingAsyncProcedure<T> proc = new BlockingAsyncProcedure<>(queryGraph.asyncBarrier, graph, null, request);
class AsyncTask extends SessionTask {
+ int counter = 0;
T result;
DatabaseException exception;
exception = dbe;
} finally {
if (entry != null)
- entry.performFromCache(queryGraph, procedure_);
+ entry.performFromCache(graph, procedure_);
}
} else {
+ if(counter++ > 10000) {
+ AsyncBarrierImpl.printReverse(queryGraph.asyncBarrier, 2);
+ AsyncBarrierImpl caller = queryGraph.asyncBarrier.caller;
+ while(caller != null) {
+ System.err.println("called by " + AsyncBarrierImpl.report(caller));
+ caller = caller.caller;
+ }
+ for(AsyncBarrierImpl ab : AsyncBarrierImpl.debuggerMap.keySet()) {
+ AsyncBarrierImpl.printReverse(ab, 2);
+ }
+ throw new IllegalStateException("Eternal loop in queries.");
+ }
graph.processor.schedule(this);
}
}