[Neo4j] Node Id generation deadlock
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
> 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
> able to create its two nodes in the meanwhile, because the first thread
> 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
> Thanks again,
> View this message in context:
> Sent from the Neo4j Community Discussions mailing list archive at
> Neo4j mailing list
> User at lists.neo4j.org
Mattias Persson, [mattias at neotechnology.com]
Hacker, Neo Technology
More information about the User