Saturday 15 February 2014

java - transactional not working in spring data neo4j -



java - transactional not working in spring data neo4j -

i using spring-data-neo4j neo4j database in application,i want have transactional apis in service layer seems @transaction not working.

service layer:

@transactional('neo4jtransactionmanager') def saveperson(){ person person=new person() person.setname("prabh") person.setdistance(100) personrepository.save(person) int i=10/0; }

configuration :

<context:component-scan base-package="neo4j"></context:component-scan> <bean id="graphdatabaseservice" class="org.springframework.data.neo4j.rest.springrestgraphdatabase"> <constructor-arg value="http://localhost:7474/db/data" /> </bean> <neo4j:config graphdatabaseservice="graphdatabaseservice" base-package="neo4j" /> <neo4j:repositories base-package="neo4j" /> <bean id="neo4jtransactionmanager" class="org.springframework.transaction.jta.jtatransactionmanager"> <property name="transactionmanager"> <bean class="org.neo4j.kernel.impl.transaction.springtransactionmanager"> <constructor-arg ref="graphdatabaseservice" /> </bean> </property> <property name="usertransaction"> <bean class="org.neo4j.kernel.impl.transaction.usertransactionimpl"> <constructor-arg ref="graphdatabaseservice" /> </bean> </property> </bean> <tx:annotation-driven mode="aspectj" transaction-manager="neo4jtransactionmanager" /> </beans>

i using rest server of neo4j database.

that's documentation says, remote access there no transactionality due neo4j's rest api not exposing transactions on wire in past

in next milestone (and current 3.3.0.build-snapshot) build new remoting integration used, exposes transactions on wire , much faster existing one.

java transactions spring-data-neo4j

No comments:

Post a Comment