#200 ✓resolved
Deepak N

Rule node creation is not thread safe

Reported by Deepak N | November 29th, 2011 @ 02:01 PM

When concurrent threads are access rule of the class for the first time, the lazy creation of rule node ends up creating multiple rule nodes for class.

I tried fix this by wrapping rule node access in a synchronize block, but it ends up in a deadlock. My guess is, these threads endup contending for neo4j db lock and this new synchronize lock added by me.

Current solution is to preload the models and access the rule node as part of app initialization.

I have added a test to expose the issue: https://github.com/endeepak/neo4j/commit/1546d4325c30aeccf07064d456...

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

Neo4j.rb is a graph database framework for JRuby.

It provides:

* Mapping of ruby objects to nodes in networks rather than in tables.
* Storage of ruby object to a file system.
* Fast traversal of relationships between nodes in a hugh node space.
* Transaction with rollbacks support.
* Indexing and quering of ruby objects.
* Integration with Rails

People watching this ticket