Categories
Uncategorized

configuring a Neo4j GraphDatabaseService via Spring

Starting with Neo4j 1.9 the constructors for EmbeddedGraphDatabase and HighlyAvailableGraphDatabase were deprecated. The recommended way to instantiate those from Java is by using factory classes as documented in the reference manual. In the case of HighlyAvailableGraphDatabase use a different factory class HighlyAvailableGraphDatabaseFactory.

If you’re using Spring for wiring components or Spring Data Neo4j then it’s up to the container to build up the GraphDatabaseService for you. Doing this with factories is a little bit more tricky but I’ve create two gists.

Creating a EmbeddedGraphDatabase

[gist id=”6028963″]

Creating a HighlyAvailableGraphDatabase

[gist id=”6222698″]

2 replies on “configuring a Neo4j GraphDatabaseService via Spring”

HighlyAvailableGraphDatabase configuration is not working for Neo4j 1.9.3 ? Any guess what more changes it need to implement ?

Leave a Reply

Your email address will not be published. Required fields are marked *