First of all, there are no transactions over the http-interface.
There is a mode of the java-rest-bindings that take all operations within a tx-boundary and send them to the server as a single batch-request. But it has some shortcomings, e.g. not allowing reads of the data you've just written and others.
So SDN uses the non-tx (or tx per request mode) of the REST API, so that there are no real transactional guarantees in this mode.
SpringRestGraphDatabase actually extends AbstractGraphDatabase, so the error that pops up is unexpected. Can you post the full exception?
Which versions of SDN and Neo4j are you using?
Michael
Am 08.10.2012 um 11:03 schrieb tims83:
Hi,
I'm using the Neo4j, spring-data-neo4j and spring-data-neo4j-rest projects and I'm trying to configure declarative transaction management. The documentation suggests that I add the following:
<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"/>
<neo4j:config graphDatabaseService="graphDatabaseService" />
<bean id="graphDatabaseService" class="org.springframework.data.neo4j.rest.SpringRestGraphDatabase">
<constructor-arg index="0" value="http://localhost:7474/db/data" />
</bean>
When I run this configuration, I'm getting the following exception:
org.springframework.data.neo4j.rest.SpringRestGraphDatabase cannot be cast to org.neo4j.kernel.AbstractGraphDatabase
This leaves me clueless on how to configure the declarative transaction management. Does this happen because a transaction can span over multiple REST calls to the server? Any advice would be much appreciated.
Thanks,
Timmy
--