title: how to avoid deadlocks with neo4j
body: <p>I just learnt that when I create a relationship between 2 nodes in neo4j, both of them are locked (<a href="http://docs.neo4j.org/chunked/stable/transactions-locking.html" rel="nofollow">http://docs.neo4j.org/chunked/stable/transactions-locking.html</a>).
  However, in our project, we have elements that we can instanciate and we finnaly have two nodes in the graph linked by a "INSTANCE_OF" relationship.
  For exemple if I instanciate element B, I have a new element B1. They are stored in the graph like B&lt;-INSTANCE_OF-B1.
  My problem is that many users can instanciate element B on same time and it result in deadlocks.
  How can I avoid these deadlocks please ? I don't need to write properties on B, I just want to "attach" B1 to B in my graph. Is having a property in B1 reprensenting the B id would be a better solution instead of linking them with a relationship ? I think it wouldn't since we lost all the graph interest, but I really don't know how to avoid theses deadlocks ?</p>
  
  <p>Thank you very much for your help</p>