Hi,
I have just started using neo4j and have just read through the
documentation found on the wiki and have a question about
synchronization.

On the neo mistakes page ( http://wiki.neo4j.org/content/Neo_Mistakes
), there is an example of what not to do called "Unnecessary
synchronization" that reads like this:

// don't do this
synchronized void methodA()
{
    nodeA.setProperty( "prop1", 1 );
    methodB();
}

synchronized void methodB()
{
    nodeB.setProperty( "prop2", 2 );
}

According to the test, "The code above is very deadlock prone when
methods A and B are called concurrently.".

Exactly why is that? I try to understand what the situation is that
should be avoided, but when I run the code in my head I can't figure
out when and why the deadlock occurs.

Best regards,
Thomas
_______________________________________________
Neo mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user

Reply via email to