All,
I am using the node-neo4j library on Node.js against Neo4j 1.8GA. The
node-neo4j library provides a Node class with a delete method that
optionally deletes all relationships on a Node prior to deleting the Node.
If the Node has multiple relationships, the library gets all
relationships on the Node and deletes them *in parallel*. If I'm reading
the code right, the request to retrieve the relationships and the request
to delete the retrieved relationships are all happening concurrently. In my
scenario, I have Node A with relationships to Nodes B, C, D. When I call
delete on Node A, I get a DeadlockDetectedException (partial stack trace
included below). I'm not clear on what resource is being locked in this
scenario. The Exception details seem very complete however I'm not quite
sure how to interpret them.
Thanks for your help.
-brian
Partial stack trace:
Details: 'Transaction(0)[STATUS_ACTIVE,Resources=1] can't wait on resource
RWLock[Relationship[27692]] since =>
Transaction(0)[STATUS_ACTIVE,Resources=1] <-[:HELD_BY]- RWLock[Node[2241]]
<-[:WAITING_FOR]- Transaction(0)[STATUS_ACTIVE,Resources=1] <-[:HELD_BY]-
RWLock[Relationship[27692]]'.
at
org.neo4j.kernel.impl.transaction.RagManager.checkWaitOnRecursive(RagManage r.java:218)
at
org.neo4j.kernel.impl.transaction.RagManager.checkWaitOnRecursive(RagManage r.java:246)
at
org.neo4j.kernel.impl.transaction.RagManager.checkWaitOn(RagManager.java:18 5)
at
org.neo4j.kernel.impl.transaction.RWLock.acquireWriteLock(RWLock.java:349)
at
org.neo4j.kernel.impl.transaction.LockManager.getWriteLock(LockManager.java :164)
at
org.neo4j.kernel.impl.transaction.LockManager.getWriteLock(LockManager.java :130)
at
org.neo4j.kernel.impl.nioneo.xa.WriteTransaction.getWriteLock(WriteTransact ion.java:870)
at
org.neo4j.kernel.impl.nioneo.xa.WriteTransaction.disconnectRelationship(Wri teTransaction.java:809)
at
org.neo4j.kernel.impl.nioneo.xa.WriteTransaction.relDelete(WriteTransaction .java:689)
at
org.neo4j.kernel.impl.persistence.PersistenceManager.relDelete(PersistenceM anager.java:166)
at
org.neo4j.kernel.impl.core.NodeManager.deleteRelationship(NodeManager.java: 989)
at
org.neo4j.kernel.impl.core.RelationshipImpl.delete(RelationshipImpl.java:14 5)
at
org.neo4j.kernel.impl.core.RelationshipProxy.delete(RelationshipProxy.java: 62)
at
org.neo4j.server.rest.web.DatabaseActions.deleteRelationship(DatabaseAction s.java:609)
at
org.neo4j.server.rest.web.RestfulGraphDatabase.deleteRelationship(RestfulGr aphDatabase.java:446)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:3 9)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImp l.java:25)