This might be a typical Java 7 template for accessing some Neo4j data.
Is there any mechanism by which you can configure a transaction to automatically fail and rollback based on a timeout?
try (Transaction tx = graphdb.beginTx()) {
Node node =
Iterable<Relationship> rels = node.getRelationships(...);
for (Relationship rel : rels) {
}
tx.success();
return data;
}
I assume that there is only int count = 0and increase each iteration, and then:
if(count > XYZ) throw TakingTooLongException(count)
?
source
share