[Neo4j] Node Id generation deadlock

Mattias Persson mattias at neotechnology.com
Thu Nov 3 10:13:39 CET 2011

2011/11/3 Cres <cresfy at gmail.com>

> This solution would have been ok if I had only one node created from that
> factory in each transaction.
> It doesn't matter... after factory.setProperty is run that transaction has
got a write lock on that factory node which is held until the transaction
committs. The benefit you get from my proposal would be that you make sure
you read the correct value.

> however, as shown in the sample code I posted in the original message, I
> have multiple nodes created in one transaction, and multiple such
> transactions in multiple threads.
> So while the creation of the actual nodes will of course be serialized, one
> thread's transaction will have to wait for the other thread's transaction
> to
> finish completely, and so if the first thread has some processing to do
> between the creation of the first and second nodes, the other third won't
> be
> able to create its two nodes in the meanwhile, because the first thread
> will
> have the lock on the factory node until the entire transaction completes.
> I'm looking for a way to do this having the nodes creation serialized but
> without having the entire transactions serialized, possibly by somehow
> releasing the lock on the factory node in mid-transaction, or by any other
> method.
> Thanks again,
> Ran.
> --
> View this message in context:
> http://neo4j-community-discussions.438527.n3.nabble.com/Node-Id-generation-deadlock-tp3473118p3476498.html
> Sent from the Neo4j Community Discussions mailing list archive at
> Nabble.com.
> _______________________________________________
> Neo4j mailing list
> User at lists.neo4j.org
> https://lists.neo4j.org/mailman/listinfo/user

Mattias Persson, [mattias at neotechnology.com]
Hacker, Neo Technology

More information about the User mailing list