Janus graph transaction cache Vertex


shrikant pachauri <sk.pa...@...>
 

Greetings...

I was working on my application with Janus graph. Now I have found a that any vertex which is fetched once in a transaction does not fetches the vertex again from the graph. Now consider my scenario 

Operation 1: Thread 1 reads a vertex in a transaction
Operation 2: Thread 2 reads the same vertex in another transaction
Operation 3: Thread 1 modifies the vertex properties and commit
Operation 4: Thread 2 read the vertex from the transaction cache and update on the older values.


Now I want changes in the operation 3 to thread 2 in operation 4 but they are not reflected in the transaction since it was cached already. Now is there any way to invalidate cached vertex if it is changed by any other transaction or to flush the transaction cache???



Regards,
Shrikant


"6702...@qq.com" <6702...@...>
 

you need g.tx().commit() before read,  commit will invalidate cached in current transacation 

在 2019年4月16日星期二 UTC+8下午2:30:55,shrikant pachauri写道:

Greetings...

I was working on my application with Janus graph. Now I have found a that any vertex which is fetched once in a transaction does not fetches the vertex again from the graph. Now consider my scenario 

Operation 1: Thread 1 reads a vertex in a transaction
Operation 2: Thread 2 reads the same vertex in another transaction
Operation 3: Thread 1 modifies the vertex properties and commit
Operation 4: Thread 2 read the vertex from the transaction cache and update on the older values.


Now I want changes in the operation 3 to thread 2 in operation 4 but they are not reflected in the transaction since it was cached already. Now is there any way to invalidate cached vertex if it is changed by any other transaction or to flush the transaction cache???



Regards,
Shrikant


Chen Wu <cjx...@...>
 

I have an additional question as follows:
After operation 4, when the thread 2 commits, will this commit failed or the value in thread 2 overwrite what thread 1 has committed?

在 2019年4月16日星期二 UTC+8下午2:30:55,shrikant pachauri写道:

Greetings...

I was working on my application with Janus graph. Now I have found a that any vertex which is fetched once in a transaction does not fetches the vertex again from the graph. Now consider my scenario 

Operation 1: Thread 1 reads a vertex in a transaction
Operation 2: Thread 2 reads the same vertex in another transaction
Operation 3: Thread 1 modifies the vertex properties and commit
Operation 4: Thread 2 read the vertex from the transaction cache and update on the older values.


Now I want changes in the operation 3 to thread 2 in operation 4 but they are not reflected in the transaction since it was cached already. Now is there any way to invalidate cached vertex if it is changed by any other transaction or to flush the transaction cache???



Regards,
Shrikant