Re: [Neo4j] Deadlock Detected while creating edges in concurrent transactions

2014-07-04 Thread ducky
Thanks. I understand the necessity of having no data corruption and hence the need for locks. But if we can get slightly less locking without giving up any of the goodness which comes with it, it'll be awesome! I've had a look at Max's latest post. I've signed up for his kickstarter as well. Re

Re: [Neo4j] Deadlock Detected while creating edges in concurrent transactions

2014-07-04 Thread Chris Vest
You can't manually release locks from on-going transactions. Write-locks protects writes that you logically only intend to do, until the transaction commits or rolls back. It might be possible to add a feature like that, but we'd have to keep the write-locks on the entities that are actually wr

Re: [Neo4j] Deadlock Detected while creating edges in concurrent transactions

2014-07-04 Thread Michael Hunger
You could acquire a coarser lock on a certain lock node for your use-case so the requests would be serialized Or you batch your operations so that the locks are held by the same tx See maxdemarzi.com blog for several examples. Sent from mobile device Am 04.07.2014 um 13:50 schrieb ducky : > T

Re: [Neo4j] Deadlock Detected while creating edges in concurrent transactions

2014-07-04 Thread ducky
Thanks Chris. What I meant was that a read-write lock on a node when an edge is being created felt heavy. If thats what is required for a transactional database like neo4j, so be it. I understand how I can handle this in my user code (by retrying or structuring my data differently). If I kn

Re: [Neo4j] Deadlock Detected while creating edges in concurrent transactions

2014-07-04 Thread Chris Vest
Hi, This is expected behaviour for transactional databases with pessimistic concurrency control. You usually handle this in user-code by retrying the transaction, making sure that external side-effects, such as sending emails and processing payments, only happen after the transaction has commit

Re: [Neo4j] Deadlock Detected while creating edges in concurrent transactions

2014-07-04 Thread ducky
Hi Chris, i) I do create more than 1 relationship per transaction. ii) As you suggest, the nodes b, c are involved in creating other relationships but not between each other. This is a real bummer. So in my case, creating locks on the nodes when creating relationships and the locks only being re

Re: [Neo4j] Deadlock Detected while creating edges in concurrent transactions

2014-07-03 Thread Chris Vest
Do you create more than one relationship per transaction? Both the start and the end node have to be lock to create a relationship between them, and locks are not released until the transaction commits. It could also be that you have some other transaction that happens to work with the start and

[Neo4j] Deadlock Detected while creating edges in concurrent transactions

2014-07-03 Thread ducky
Hi, I am using Neo4j 2.1.2 and I have an unmanaged extension in which I am trying to create the following relationships in separate concurrent transactions: 1) (b)-[:REL]->(a) 2) (c)-[:REL]->(a) I am never deleting any relationship and I am getting this error: org.neo4j.kernel.DeadlockDetected