cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Exclusive locks - requests take a long time

I have many long term requests like:


MATCH (tx: Survey {uuid: {Id}}), (p: Person {personId: {personId}}), 
MATCH (d: Day {day: {day}})
MATCH (rs: Result {ResultId: {resultId}, isActual: true})
CREATE (ex: SurveyResult) 
CREATE (ex)-->(rs) 
CREATE (ex)-[:comesFrom]->(tx) 
CREATE (ex)-[:executedBy]->(p) 
CREATE (ex)-[:savedOn]->(d) WITH ex UNWIND {answers} AS answer MATCH (a:Answer {uuid: answer}) CREATE (ex)-[:respondedWith]->(a)"

with status=waiting with deadlocks (CALL dbms.listQueries()) like:

resourceInformation
{
"waitTimeMillis": 10788,
"lockMode": "EXCLUSIVE",
"resourceType": "NODE",
"resourceIds": [
8199666
]
}

Requests take a long time, they don't want to end. I checked resourceIds and they are the identifiers of Result objects. These objects are involved in both getSurvey and saveSurveyResult requests. What's wrong?

I'm using neo4jDriver 1.7.91 that is compatible with neo4j 3.6.2

1 ACCEPTED SOLUTION

This type of errors stopped appearing after adding index to the uuid field.

View solution in original post

2 REPLIES 2

Can you run an EXPLAIN of the query and add that here?

Also, there have been significant locking improvements with respect to relationship creation and deletion in 4.3.x. We'd recommend upgrading to 4.3.4 or later.

This type of errors stopped appearing after adding index to the uuid field.

Nodes 2022
Nodes
NODES 2022, Neo4j Online Education Summit

All the sessions of the conference are now available online