We avoid hot deployment for a whole body of reasons...not just neo. ----- Reply message ----- From: "Wilson, Kalin" <kwil...@scitor.com> Date: Wed, Nov 10, 2010 7:52 pm Subject: [SPAM] [Neo4j] Using EmbeddedGraphDatabase in Tomcat To: <user@lists.neo4j.org>
I am trying to learn Neo4J and prototype a simple web app using a simple servlet/JSP approach (no Spring or other framework) in Tomcat. I have an instance of EmbeddedGraphDatabase that gets stored in a ThreadLocal variable for use by other classes in a Singleton manner. This singleton variable gets initialized in a ServletContextListener and shutdown() gets called in the listener's contextDestroyed() method. The first time the app is started the database is initialized properly and everything seems OK. However, if I make code changes in a debugging session and the changed files get hot deployed, subsequent database accesses result in a lock exception. To recover I have to kill tomcat and delete the database files. It doesn't seem that I'm calling shutdown() at the right time to protect the database. I'm assuming that database access should be through some sort of singleton, is this correct? I'm used to using a JPA EntityManager. Assuming I can't use Spring injection, etc, what is the recommended pattern for managing the GraphDatabaseService instance in a web app? Any help is appreciated. Kalin _______________________________________________ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user _______________________________________________ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user