public void shutdown() { try { if (database != null) database.shutdown(); } finally { deleteResources(); database = null; } }
public void create() throws IOException { createResources(); try { GraphDatabaseFactory factory = newFactory(); configure(factory); GraphDatabaseBuilder builder = newBuilder(factory); configure(builder); database = (GraphDatabaseAPI) builder.newGraphDatabase(); } catch (RuntimeException e) { deleteResources(); throw e; } }