6
votes

I use Spring 4.1.6.RELEASE and Spring Boot 1.2.3.RELEASE. Right now, I can't smoothly move from Neo4j 2.1.7 and SDN 3.2.2.RELEASE to Neo4j 2.2.0 and SDN 3.3.0.RELEASE

First of all, Neo4jHelper class is absent... so what should be used instead ?

Also, my tests crashes with a following exceptions:

org.springframework.dao.InvalidDataAccessApiUsageException: nested exception is org.neo4j.graphdb.NotInTransactionException
    at org.springframework.data.neo4j.support.Neo4jExceptionTranslator.translateExceptionIfPossible(Neo4jExceptionTranslator.java:51)
    at org.springframework.dao.support.ChainedPersistenceExceptionTranslator.translateExceptionIfPossible(ChainedPersistenceExceptionTranslator.java:59)
    at org.springframework.dao.support.DataAccessUtils.translateIfNecessary(DataAccessUtils.java:213)
    at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:147)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:207)

but on the previous versions everything work fine(My DAO and Services are annotated with @Transactional).

How to configure appropriate TX manager for Neo4j in my Spring Boot application ?

Right now NullTransactionManager are used and I think this is a reason of the issue:

2015-04-03 11:40:36 [main] INFO  o.s.c.a.AnnotationConfigApplicationContext - Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@12db5286: startup date [Fri Apr 03 11:40:36 EEST 2015]; root of context hierarchy
2015-04-03 11:40:37 [main] INFO  o.s.b.f.a.AutowiredAnnotationBeanPostProcessor - JSR-330 'javax.inject.Inject' annotation found and supported for autowiring
2015-04-03 11:40:38 [main] INFO  o.s.t.jta.JtaTransactionManager - Using JTA UserTransaction: org.springframework.transaction.jta.UserTransactionAdapter@5909b7c2
2015-04-03 11:40:38 [main] INFO  o.s.t.jta.JtaTransactionManager - Using JTA TransactionManager: org.springframework.data.neo4j.config.NullTransactionManager@16bc4d92

what I'm doing wrong ?

1

1 Answers

5
votes

This is work in progress, I have it in a branch but it's not done yet as Neo4j 2.2 changed many internal APIs.

Stay tuned over the next week or so.