Hi Sulabh,

You can only have one instance of Neo4j over a particular directory. As such, 
when you want to have multiple threads talking to a single Neo4j, you will need 
to pass that reference around to each thread.

Thus, when Rexster is running over Neo4j, Rexster has that reference. To have 
other threads/software talk to Neo4j via Rexster, you can talk to it with:

        1. The RESTful interface: 
https://github.com/tinkerpop/rexster/wiki/Basic-REST-API
        2. Via Gremlin: https://github.com/tinkerpop/rexster/wiki/Using-Gremlin 
        3. By writing an Extension (Rexster-Kibble): 
https://github.com/tinkerpop/rexster/wiki/Creating-an-Extension
                https://github.com/tinkerpop/rexster-kibbles/wiki

In other words, its illegal to do this:

g1 = new Neo4jGraph('/tmp/graph');
g2 = new Neo4jGraph('/tmp/graph');

You get the "Unable to lock store" exception. However you can do this:

g = new Neo4jGraph('/tmp/graph');
createThreadAndProcessGraph(g);

It all comes down to reference to the original instance.

Thanks,
Marko.

http://markorodriguez.com

On May 11, 2011, at 11:33 AM, sulabh choudhury wrote:

> A similar question has been asked previously but I could not find a solution 
> which would work for me, hence re-posting it.
> 
> I am creating a Neo4j graph and want to expose it over REST using Rexster so 
> that I can apply traversals to it.
> Now after I have started Rexster, I see that I cannot write to the graph as 
> it throws the "java.lang.IllegalStateException: Unable to lock store 
> [complete_graph//neostore], this is usually a result of some other Neo4j 
> kernel running using the same store."
> 
> So does this mean everytime I have to write to the graph I have to shut down 
> Rexster (hence disabling my traversals) and then start it again after I 
> finish writing to it?
> I read somewhere that you cannot start multiple  services to same store in 
> write mode, so is there a way where I can expose it over Rexster just in read 
> mode and perform traversals ?
> 
> Or is there any way around this problem ?

_______________________________________________
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user

Reply via email to