Georg, normally people shut down Neo4j and delete the db directory in order to get rid of the entire db. However, I see your point in having a fast way to bulk delete the _content_ of the db.
It's not totally simple to do that nicely, so Johan just wrote a note to look at this after Neo4j 1.1. It will probably be a helper doing this, but it needs closer examination. Would that be ok for you? Cheers, /peter neubauer COO and Sales, Neo Technology GTalk: neubauer.peter Skype peter.neubauer Phone +46 704 106975 LinkedIn http://www.linkedin.com/in/neubauer Twitter http://twitter.com/peterneubauer http://www.neo4j.org - Your high performance graph database. http://www.thoughtmade.com - Scandinavia's coolest Bring-a-Thing party. On Fri, Jul 9, 2010 at 12:33 AM, Georg M. Sorst <[email protected]> wrote: > Hi list, > > is there a way to clean the DB and the indices programmatically? > > The reason I'm looking for this is that I'm using (and instantiating) > Neo4j from Spring. This works just great, however in order to run my > tests from a clean state I need a way to clean the DB and indices. > Stopping Neo4j and deleting the store dir is not really a viable option > as I would have to recreate the start-up sequence that I have already > defined in my Spring context config. > > What I'm currently doing is iterate over the entire graph and delete all > nodes and relationships. This works fine most of the time but sometimes > gives me unexpected errors like "Node[xyz] has been deleted in this TX". > This seems to be especially true when I run all tests in succession. > Another problem with that approach is that there doesn't seem to be a > way to find out which indices currently exist making it hard to safely > delete them all. > > So, any pointers would be greatly appreciated. > > Thanks and best regards, > Georg > _______________________________________________ > Neo4j mailing list > [email protected] > https://lists.neo4j.org/mailman/listinfo/user > _______________________________________________ Neo4j mailing list [email protected] https://lists.neo4j.org/mailman/listinfo/user

