How to refresh janusgraph objects within a connection?


Jack Waudby <jackw...@...>
 

Hi, I have JanusGraph server backed by Cassandra and Elasticsearch. I'm running two threads through the Java API 1 thread (Thread-A) is issuing transactions that increment a property on a node. The other thread (Thread-B) issuing transactions that read the property on that node. Once the property has been read once all subsequent reads across transactions on Thread-A return the same value, even though Thread-B has updated it. I've tried turning off the db-cache but it made no difference. I've also tried issuing reads from the Gremlin console whilst the java process is updating the property and I again experience the same behaviour. Any suggestion why this is happening?


HadoopMarc <bi...@...>
 

Hi Jack,

Just one suggestion: apart from the db-cache JanusGraph uses a transaction cache. For read operations through the java API JanusGraph keeps using the same transaction until the transaction is committed or rolled back. So, maybe give that a try (g.tx().rollback()).

I take it you also read the docs section on db-cache expiration time.

Marc

Op zaterdag 13 juni 2020 19:38:13 UTC+2 schreef Jack Waudby:

Hi, I have JanusGraph server backed by Cassandra and Elasticsearch. I'm running two threads through the Java API 1 thread (Thread-A) is issuing transactions that increment a property on a node. The other thread (Thread-B) issuing transactions that read the property on that node. Once the property has been read once all subsequent reads across transactions on Thread-A return the same value, even though Thread-B has updated it. I've tried turning off the db-cache but it made no difference. I've also tried issuing reads from the Gremlin console whilst the java process is updating the property and I again experience the same behaviour. Any suggestion why this is happening?