package org.simantics.db.impl.query;
import org.simantics.db.AsyncReadGraph;
+import org.simantics.db.common.GraphSemaphore;
import org.simantics.db.exception.DatabaseException;
import org.simantics.db.impl.DebugPolicy;
import org.simantics.db.impl.graph.ReadGraphImpl;
try {
+ GraphSemaphore s = new GraphSemaphore(graph, 0);
+
request.perform(graph , new AsyncProcedure<T>() {
@Override
public void execute(AsyncReadGraph graph, T result) {
addOrSet(graph, result);
+ s.release();
}
@Override
public void exception(AsyncReadGraph graph, Throwable t) {
except(t);
+ s.release();
}
});
+ s.waitFor(1);
+
} catch (Throwable t) {
except(t);
}