I am using Node.js to connect to a hosted GrapheneDB Neo4j database and when attempting to add about 1,500 records I get the following error:
LockClient[19] can't wait on resource
RWLock[NODE(248), hash=1917331445] since => LockClient[19]
<-[:HELD_BY]- RWLock[INDEX_ENTRY(153122458561043471), hash=1171319680]
<-[:WAITING_FOR]- LockClient[15] <-[:HELD_BY]- RWLock[NODE(248), hash=1917331445]
The code that generates this comes from a route that takes a list of JSON objects and then stores them in Neo4j. When importing approx 1,500 records I get this error consistently.
Using seraph-model to do the database accessing and just looking up the record, updating if it exists or creating it if it doesn't.
Any suggestions where to investigate?
It looks like you're doing multiple large transactions concurrently hitting the same region of your graph.
When Neo4j performs a write, a write lock is acquired on that node/relationship and released when the transactions is closed. Other transaction running concurrently who try to acquire a write lock on a already locked entity need to wait - otherwise a box of pandora's inconsistencies would have had opened. If the owner of the lock is a rather long running transaction, the other one might run into a timeout - that would be the above error message.
So you can either: