Deadlock creating Indexes in 2.0.1

13 views
Skip to first unread message

Matthew Hodges

unread,
May 6, 2014, 11:29:50 AM5/6/14
to Node-Neo4j Discussion
I got a deadlock creating an index via CYPHER, creating users and then adding an index like this:

            query = "START s=node({sid}) CREATE (n:user {props})-[r:schema]->(s) RETURN n";

            query = "CREATE INDEX ON :user( username )";
 
I got it to work like this:

1.  First I tried the CREATE INDEX query in the neo4j-shell and got the same error;
2.  So I stopped and restarted neo4j; then it worked in the shell;
3.  I switched the order of the queries, so instead of creating users first and then adding the index, I created the index first.  It works ok now.

Indexes are new in version 2 and may be fragile--bunch of people seem to be hitting this deadlock.

Cheers,
Matt Hodges

Aseem Kishore

unread,
May 12, 2014, 6:49:14 AM5/12/14
to Matthew Hodges, Node-Neo4j Discussion
Sorry for the delay Matt — was out of the country.

This sounds like a Neo4j issue, not anything to do with the node-neo4j library. Try posting on the main Neo4j mailing list if you haven't already.

Thanks for the tip in the meantime!

Cheers,
Aseem

sridhar

unread,
Jul 30, 2024, 6:02:02 AM7/30/24
to Node-Neo4j

To download and install Node-Neo4j, first ensure you have Node.js installed, then initialize a new Node.js project using npm init -y, install the Neo4j driver with npm install neo4j-driver, create a JavaScript file to establish a connection to your Neo4j database and run a query, and finally execute your script using node <your_script_name>.js.

Reply all
Reply to author
Forward
0 new messages