Reputation: 25780
In my Neo4j + Spring Neo4j Data + Spring Boot application I have a following configuration
@Bean(destroyMethod = "shutdown")
public GraphDatabaseService graphDatabaseService() {
// @formatter:off
GraphDatabaseService graphDb = new GraphDatabaseFactory()
.newEmbeddedDatabaseBuilder(environment.getProperty(NEO4J_EMBEDDED_DATABASE_PATH_PROPERTY))
//.setConfig(GraphDatabaseSettings.pagecache_memory, "2g")
.setConfig(GraphDatabaseSettings.node_keys_indexable, "name,description")
.setConfig(GraphDatabaseSettings.node_auto_indexing, "true")
.newGraphDatabase();
// @formatter:on
return graphDb;
}
I need to (1)shutdown this db, (2)delete database files on disk and then (3)start this database again.
I know how to perform steps #1 and #2 but how to start and initialize the database again ?
Upvotes: 0
Views: 184
Reputation: 328
When you delete database files on disk, your DB is gone ... You can try to recreate a new, empty one, repeating your init code, but it is probably not the task you intent to do ???
Upvotes: 1