The issue is at the factory.getOrCreate throws a NPE if Batch Transactions are enabled:
Exception in thread "main" java.lang.NullPointerException
at org.neo4j.rest.graphdb.index.SimpleIndexHits.getSingle(SimpleIndexHits.java:67)
at org.neo4j.rest.graphdb.index.SimpleIndexHits.getSingle(SimpleIndexHits.java:37)
at org.neo4j.graphdb.index.UniqueFactory.getOrCreate(UniqueFactory.java:197)
The problem is due to I think:
public T getSingle() {
Iterator<Object> it = hits.iterator();
return it.hasNext() ? transform(it.next()) : null;
}
The example in the Neo4j docs won't work due to NPE: http://docs.neo4j.org/chunked/milestone/transactions-unique-nodes.html
The issue is at the factory.getOrCreate throws a NPE if Batch Transactions are enabled: Exception in thread "main" java.lang.NullPointerException at org.neo4j.rest.graphdb.index.SimpleIndexHits.getSingle(SimpleIndexHits.java:67) at org.neo4j.rest.graphdb.index.SimpleIndexHits.getSingle(SimpleIndexHits.java:37) at org.neo4j.graphdb.index.UniqueFactory.getOrCreate(UniqueFactory.java:197)
The problem is due to I think:
"hits" is null causing the error.