Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
05-10-2020 10:29 AM
Neo4j allows acquisition of shared read locks on nodes and edges by using org.neo4j.graphdb.Transaction::acquireReadLock
. Since this functionality is not available via Cypher, according to https://neo4j.com/docs/java-reference/current/transaction-management/isolation/, a workaround is for readers to perform an otherwise useless write in order to implicitly acquire a write lock, preventing any concurrent writers from modifying the node. However, this also locks out all other concurrent writers.
Is there any other way, besides, org.neo4j.graphdb.Transaction::acquireReadLock
, for acquiring a shared read lock on a node?
Solved! Go to Solution.
05-10-2020 01:26 PM
APOC to the resuce!
You could use CALL apoc.lock.read.nodes(<list of nodes>)
or CALL apoc.lock.read.rels(<list of rels>)
. Standard cypher does not provide any way to acquire read locks.
05-10-2020 01:26 PM
APOC to the resuce!
You could use CALL apoc.lock.read.nodes(<list of nodes>)
or CALL apoc.lock.read.rels(<list of rels>)
. Standard cypher does not provide any way to acquire read locks.
All the sessions of the conference are now available online