andreasronge/neo4j — pull request #78 by vivekprahlad (2011-12-02 10:18:16+00:00)
Title: Fix for rule node concurrency issue

Hi Andreas,

Here's a fix for the concurrency issue - it's mostly based on your patch, but there's a small change to the synchronization code. I'll try and see if I can get the locking to be a bit more fine grained later.

JRuby seems to allow calling java_object.synchronize - I actually wanted to be able to lock on the key symbol object (basically, this issue occurs when creating rule nodes for a particular type within a tenant, so the combination of tenant + class name as a lock is perfect), but it looks like it isn't possible. I may have to work with interned Java strings instead.

Cheers,
Vivek