On Tuesday, October 9, 2012 9:52:53 AM UTC+2, Michael Hunger wrote:
> Timmy,
> to use Neo4j 1.7 or 1.8 you should upgrade to SDN 2.1.RC4.
> If you want to encapsulate multiple operations in one call you can either
> use a cypher statement which contains the operations that you want to
> execute.
> Or you use the RestAPI.executeBatch() method which records your calls
> within the callback and then sends them all over in a single
> rest-batch-operation (which is executed in a single tx) and fills in
> read-values after the request returns.
> See:
> http://docs.neo4j.org/chunked/milestone/rest-api-batch-ops.html
> https://github.com/neo4j/java-rest-binding/blob/master/src/test/java/...
> HTH
> Michael
> Am 09.10.2012 um 09:38 schrieb tims83 <timmy....@continuum.be<javascript:>
> >:
> Thanks for your reply. I'm using SDN version 2.0.1.RELEASE and Neo4J
> version 1.6.3. When I use version 1.7.2 or 1.8 of Neo4J, I'm getting
> another exception (see below). But probably this makes sense right, since
> declarative transaction management cannot be used when using the REST
> approach. I understand that it's one transaction per request. If multiple
> requests are made in a single method, they would all run in a different
> transaction. Any ideas on what a good approach would be to handle
> situations like this? What if one of those calls fails?
> org.springframework.beans.factory.UnsatisfiedDependencyException: Error
> creating bean with name
> 'org.neo4j.kernel.impl.transaction.SpringTransactionManager#19713ea'
> defined in URL [file:/applicationContext-db.xml]: Unsatisfied dependency
> expressed through constructor argument with index 0 of type
> [org.neo4j.kernel.GraphDatabaseAPI]: Could not convert constructor argument
> value of type [org.springframework.data.neo4j.rest.SpringRestGraphDatabase]
> to required type [org.neo4j.kernel.GraphDatabaseAPI]: Failed to convert
> value of type 'org.springframework.data.neo4j.rest.SpringRestGraphDatabase'
> to required type 'org.neo4j.kernel.GraphDatabaseAPI'; nested exception is
> java.lang.IllegalStateException: Cannot convert value of type
> [org.springframework.data.neo4j.rest.SpringRestGraphDatabase] to required
> type [org.neo4j.kernel.GraphDatabaseAPI]: no matching editors or conversion
> strategy found
> Thanks,
> Timmy
> On Monday, October 8, 2012 6:41:40 PM UTC+2, Michael Hunger wrote:
>> 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
>> --
> --