I was wondering if I explicitly acquire a read lock then use the node, will the transaction drop the lock?
I tried running a test for this but for some reason when I tried to run more than 2 cypher queries in a transaction using neo4j sandbox, the transaction stalled on the third and didn't give me a reason.
Is the read lock on node (a: A) ever dropped during the transaction, after it is acquired in the explicit apoc.lock.read call?
def fn(tx):
tx.run("MATCH (a: A) call apoc.lock.read.nodes([a]) RETURN NULL").consume()
# POINT 1
tx.run("MATCH (a: A) RETURN a.prop").consume()
# POINT 3
tx.run("call apoc.util.sleep(10000) RETURN NULL").consume()
# POINT 4
return TRUE
with driver.session() as session:
session.read_transaction(fn)
And then I try to use the techniques on that page to find the locks held by the process. However, it seems like the process just never runs the third part of the transaction and just gets stuck after point 2 with no active query.