Question 1 about Transaction read locks : when doing tx.acquireReadLock on a node, does all relationships linked to this node are also locked, or do we explicitly need to acquire a lock also for them ? Is it possible for a concurrent transaction to delete a relationship linked to a node which has been locked ?
Question 2
Let's say we have the given situation :
Thread 1 (READ-ONLY transaction)
Node node = graphdb.getNodeById(0L);
tx.acquireReadLock(node);
node.getAllProperties();
Thread 2 (WRITE transaction)
Node node = graphdb.getNodeById(0L);
node.delete();
Is it possible to be in the situation where node in Thread 1 still exists (node != null) but write lock has been acquired in Thread 2 before read lock has been acquired in Thread 1 ? If yes, what is the behavior of acquireReadLock ? Is it possible to have a NotFoundException when doing the getAllProperties call even if it is preceded by an acquireReadLock call ?
Question 3
When using a user defined store procedure which uses a org.neo4j.graphdb.Node as field type for the result, is it possible to get a NotFoundException while streaming the results because one of the provided nodes has been deleted by a concurrent transaction ? In this case, does a tx.acquireReadLock should prevent this to happen or should we use a Map<String, Object> (filled by a node.getAllProperties()) instead of Node ?
Question 4 : I have store procedure which is traversing a graph and returns the nodes and relationships traversed. I want to avoid any NotFoundException caused by a concurrent transaction which could delete a node or relationship. Is it enough and advised to call tx.acquireReadLock on each node ?
Thanks a lot.