Closed johnrevill closed 2 years ago
Hi,
It is only sort of a bug seeing as that feature is not implemented for edges.
For vertices a thread local vertex cache is used to keep them synchronized but this is not implemented for edges.
TinkerPop itself does not have strong semantics around transactions nor the state of 'stale' objects.
I'll add this ticket on the //TODO list.
I see, that makes sense. Thanks for your clarity on it.
I am removing the vertex transaction scoped cache and will not be doing one for edges. It causes subtle bugs and I am a fan of rule #1 of caches. i.e. 'don't cache'
Hello.
I was just testing against a local Postgresql DB (version 9.5 on Linux/Ubuntu 14.04) using the 1.1.0RC2 version from maven (http://mvnrepository.com/artifact/org.umlg/sqlg-postgres/1.1.0.RC2) and
It looks like if there's two different Edge objects that refer to the same actual edge, then updating properties on one of those Edge objects is not reflected in the other Edge property. Not too sure if this is a bug, or a misunderstanding on my part.
The situation is captured in the rough unit test below. It fails on the very last assertion as the "anotherKey" property was not present on one of the Edge objects. At this point, the property is actually both in the DB and present in the other Edge object.
The same situation doesn't seem to affect properties on two Vertex objects referring to the same actual vertex.
Not sure if it helps, but it looks like the condition in the SqlgEdge.load() method (https://github.com/pietermartin/sqlg/blob/1.1.0.RC2/sqlg-core/src/main/java/org/umlg/sqlg/structure/SqlgEdge.java#L230) is finding that the edge's properties are not empty and just considering the edge's properties as already having been loaded and up to date.
Cheers, John