Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

Is it possible to use the WrappingNeoServerBootstrapper with spring-data-neo4j?

When using an embedded database without spring-data-neo4j, one can use a WrappingNeoServerBootstrapper to enable the REST-interface and the Webadmin. I use spring-data-neo4j and an embedded db (<neo4j:config storeDirectory="target/graph.db"/> in spring context) and would like to use the webadmin and rest-interface.

Is there any way to accomplish this?

I am also wondering if spring-data-neo4j-rest handles transactions?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
795 views
Welcome To Ask or Share your Answers For Others

1 Answer

That should be no problem. The config below is not tested, but should work and give you an idea how to set it up.

<neo4j:config graphDatabaseService="gds"/>

<bean id="gds" class="...EmbeddedGraphDatabase">
  <constructor-arg value="target/graph-db"/>
</bean>

<bean id="serverWrapper" class="...WrappingNeoServerBootstrapper" init-method="start" destroy-method="stop">
   <constructor-arg ref="gds"/>
</bean>

Transactions are handled the same way as the Neo4j-REST API does it. One per request. The underlying neo4j-rest-graphdb library also supports the REST-Batch API but that is not yet leveraged in SDN.

Update:

Please also add the dependency for the webadmin static files to your project, something like this:

<dependency>
  <groupId>org.neo4j.app</groupId>
  <artifactId>neo4j-server</artifactId>
  <version>1.5</version>
  <type>jar</type>
  <classifier>static-web</classifier>
</dependency>

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...