Thanks Sujit and Saikat. I managed to get it up and running now. Regarding the 2 process issue - I have a homegrown ApplicationContext loader which was loading graph context twice. Managed to figure it out after Sujit's suggestion.
On Tue, Aug 16, 2011 at 11:18 PM, Sujit Pal <[email protected]> wrote: > Hi Vipul, > > I saw the same issue when trying to expose an embedded Neo4j database > (plus some other things) via a Spring webapp. > > *"Caused by: java.lang.IllegalStateException: Unable to lock store > [\neo4j\db\project\graph-project\neostore], this is usually a result of > some other Neo4j kernel** running using the same store." * > > The problem was that I was trying to instantiate the > GraphDatabaseService from two components with a new(). > > I ended up building a factory that instantiates a singleton and returns > a reference to the same GraphDatabaseService using a getInstance() > method to all the components that need a handle to it. > > In my spring config I declare the bean containing the > GraphDatabaseService (nodeService) like so: > > <bean id="nodeService" class="...NodeServiceFactory" > factory-method="getInstance" destroy-method="destroy"/> > > where the NodeServiceFactory exposes 2 static methods getInstance() that > returns the singleton reference and destroy which closes the reference > on application shutdown. > > In the app, where I was doing a nodeService = new NodeService(), I > replaced with nodeService = NodeService.getInstance(). > > -sujit > > > _______________________________________________ > Neo4j mailing list > [email protected] > https://lists.neo4j.org/mailman/listinfo/user > _______________________________________________ Neo4j mailing list [email protected] https://lists.neo4j.org/mailman/listinfo/user

