Announcement Announcement Module
Collapse
No announcement yet.
Configuring transactions with Neo4J 1.7 - old way no longer working! Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Configuring transactions with Neo4J 1.7 - old way no longer working!

    Hi,
    I have just upgraded to Neo4J 1.7 and the old way of configuring transactions (still present in the 2.1.0-SNAPSHOT docs) doesn't seem to work any more:
    Code:
    <property name="userTransaction">
       <bean class="org.neo4j.kernel.impl.transaction.UserTransactionImpl">
          <constructor-arg ref="graphDatabaseService" />
       </bean>
    </property>
    The UserTransactionImpl no longer has that constructor:
    org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'org.neo4j.kernel.impl.transaction.UserTransaction Impl#105c552f' defined in file [...]: Could not resolve matching constructor (hint: specify index/type/name arguments for simple parameters to avoid type ambiguities)

    Is the new way of configuring the transactions documented somewhere? Also, should the main docs be updated?
    Thanks.
    Eugen.

  • #2
    Sorry this was a breaking change in Neo4j 1.7 (which will be reverted in 1.8).

    Could you temporarily change it to this EL construct:

    Code:
    <bean  class="org.neo4j.kernel.impl.transaction.UserTransactionImpl">
       <constructor-arg value="#{graphDatabaseService.txManager}" />
    </bean>

    Comment


    • #3
      No worries,
      I solved it like this:

      Code:
      <bean id="springTransactionManager" class="org.neo4j.kernel.impl.transaction.SpringTransactionManager">
      	<constructor-arg ref="graphDatabaseService"/>
      </bean>
      <bean id="userTransaction" class="org.neo4j.kernel.impl.transaction.UserTransactionImpl">
      	<constructor-arg ref="springTransactionManager"/>
      </bean>
      <bean id="neo4jTransactionManager" class="org.springframework.transaction.jta.JtaTransactionManager">
      	<property name="transactionManager" ref="springTransactionManager"/>
      	<property name="userTransaction" ref="userTransaction"/>
      </bean>
      Thanks.

      Comment

      Working...
      X