import org.simantics.db.exception.DatabaseException;
import org.simantics.db.exception.InternalException;
import org.simantics.db.exception.RuntimeDatabaseException;
+import org.simantics.db.impl.graph.ReadGraphImpl;
import org.simantics.db.impl.graph.WriteGraphImpl;
import org.simantics.db.impl.query.QueryProcessor;
import org.simantics.db.request.WriteOnly;
void stopReadTransaction() throws DatabaseException {
lock.lock();
try {
- assert (!queryProvider.hasScheduledUpdates());
+ assert (!queryProvider.listening.hasScheduledUpdates());
assert (readCount == 1);
session.writeSupport.gc();
transactionToken.stopReadTransaction();
throw new InternalException("Cancel failed. This should never happen.");
// System.out.println("session cs: " + session.clientChanges);
// System.out.println("reverse cs: " + cs);
- queryProvider.performDirtyUpdates(graph);
- queryProvider.performScheduledUpdates(graph);
+ queryProvider.propagateChangesInQueryCache(graph);
+ queryProvider.listening.fireListeners(graph);
} catch (DatabaseException e) {
Logger.defaultLogError(e);
}
// This will send and accept the reverse change set.
transactionToken.cancelEnd(session.writeSupport, null, session.clusterStream);
} else {
- queryProvider.performDirtyUpdates(graph);
- queryProvider.performScheduledUpdates(graph);
+ queryProvider.propagateChangesInQueryCache(graph);
+ queryProvider.listening.fireListeners(graph);
}
}
session.writeSupport.clearMetadata();
// start = System.nanoTime();
- queryProvider.performScheduledUpdates(graph);
+ queryProvider.propagateChangesInQueryCache(graph);
+ queryProvider.listening.fireListeners(graph);
+
+// ReadGraphImpl listenerGraph = graph.forRecompute(null);
+// listenerGraph.asyncBarrier.inc();
+// queryProvider.listening.fireListeners(listenerGraph);
+// listenerGraph.asyncBarrier.dec();
+
// duration = System.nanoTime() - start;
// System.out.println("performScheduledUpdates " + 1e-9*duration + "s. ");
// Process updates as long as pending primitives exist
while (session.dirtyPrimitives) {
session.dirtyPrimitives = false;
- queryProvider.performDirtyUpdates(graph);
- queryProvider.performScheduledUpdates(graph);
+ queryProvider.propagateChangesInQueryCache(graph);
+ queryProvider.listening.fireListeners(graph);
}
if (!writeOnly) // TODO: fix me! FIX ME! Please fix me! Please!