We feel like we finally have an explanation for the odd behavior we've been seeing in neo4j-ogm. We initially thought it had something to do with equals/hashcode implementation, but that's not the case.
It seems ogm is keeping a cached copy of the graph, and within a transaction all retrievals point to the same memory object.
We created a unit test to demonstrate the behavior (some of the pseudo code of what doesnt work is below)
//all within the same transactional
//retrieve an object from the database
NodeObject no1 = repository.loadObject();
//update some values on the object
no1.setValue("whatever");
//retrieve the same database object into a new java object
NodeObject no2 = repository.loadObject();
//at this point no2 and no1 are the same java object, and any value changes to no1 have been reverted to no2, as is in the database.
This is particularity seeming to be a problem for us.
We had observed this before and eliminated it by changing the depths of the objects retrieved (to prevent their graph from reverting things in memory) but that is less customizable when its not using our cypher query.
Please let us know how to avoid this issue!