In Process Neo4j 4.4.4 Enterprise (with BOLT port exposed)
Spring Boot 2.6.4
Spring Data Neo4j 5.3.9.RELEASE (connected using this example)
Issue
Neo4j's isolation level is Read Committed. If I start a transaction, subsequent MATCH queries within the same transaction may show different results if the data in the database changes in the meantime.
OGM behaves differently. As long as there is no write operation from within the same transaction or an active call to session.clear(), it does not reflect changes from the database for entities that have already been loaded before within the same transaction.
Reproduction case:
3 Threads T1, T2, T3 perform the following operations
T1 starts a transaction, creates an entity and commits the transaction
T2 starts a transaction and reads the entity that was created by T1; T2 keeps its transaction running
T3 starts a transaction, modifies the entity in the DB and commits the transaction
T2 reads the same entity again
-> In step 5. OGM returns the object from its cache and does not realize the entity was changed in the database. I query all people with last name Miller and OGM suddenly presents me people with last name Doe.
Setup
Issue
Neo4j's isolation level is Read Committed. If I start a transaction, subsequent MATCH queries within the same transaction may show different results if the data in the database changes in the meantime. OGM behaves differently. As long as there is no write operation from within the same transaction or an active call to session.clear(), it does not reflect changes from the database for entities that have already been loaded before within the same transaction.
Reproduction case:
-> In step 5. OGM returns the object from its cache and does not realize the entity was changed in the database. I query all people with last name Miller and OGM suddenly presents me people with last name Doe.