The remaining GraphSail-on-Neo4jGraph issues (apart from those which are fixed with the setCheckElementsInTransaction(true) hack) are related to the inconsistent behavior of Neo4jGraph's key indices. One immediate problem is that if you remove a vertex or edge, and then look up the vertex or edge with an index-based getVertices(String, Object) or getEdges(String, Object), you will get back a reference to a non-existent element which will then fail with a transaction error if you try to use it (e.g. by getting a property value).
The following test case has been added (but commented out) at the bottom of KeyIndexableGraphTestSuite. It passes for DexGraph and TinkerGraph, but fails for Neo4jGraph:
KeyIndexableGraph graph = (KeyIndexableGraph) graphTest.generateGraph();
Vertex v1 = graph.addVertex(null);
assertEquals(0, count(graph.getVertices("foo", 42)));
Note the Neo4jGraph.checkElementInTransaction(boolean). That's how you force this to work.
No, it doesn't.
Doh. This is fixed now with Neo4jGraph.checkElementInTransaction(boolean) .. the problem was I didn't call the right contructor. It should work now.
I had this:
return new Neo4jVertexIterable(this.rawGraph.index().getNodeAutoIndexer().getAutoIndex().get(key, value), this);
Instead of this:
return new Neo4jVertexIterable(this.rawGraph.index().getNodeAutoIndexer().getAutoIndex().get(key, value), this, this.checkElementsInTransaction());
And like magic, Neo4jGraphSailTest passes :-) :-)