I am doing some experiments with the InMemoryStoreManager and facing some issue with transactions in that case. When I produce vertices in one thread and commit them in bulk, that commit seems to be not atomic for other threads. I wrote the following test to reproduce the issue:
final GraphTraversalSource g = graph.traversal ();
for (int i = 0; i < ITERATIONS; i++) {
final int count = g.V ().toList ().size ();
assertTrue ("Expecting a multitude of " + CHUNK_SIZE + " but received " + count, count % CHUNK_SIZE == 0);
Thread.sleep (10);
}
cache.rollback ();
} finally {
producer.join ();
}
}
The producer creates vertices and commits them in chunks of 10. Hence, I would expect that other threads will see all of these 10 or none of them. Unfortunately, there seems to be no such atomicity, at least the reading thread sometimes sees only a few of the commited vertices. Am I doing something wrong here or does the InMemoryStoreManager not offer any atomicity guarantees?