无法移至Neo4j 2.2.0和Spring Data Neo4j 3.3.0. [英] Can't move to Neo4j 2.2.0 and Spring Data Neo4j 3.3.0.RELEASE
问题描述
我使用Spring 4.1.6.RELEASE和Spring Boot 1.2.3.RELEASE. 现在,我无法顺利地从Neo4j 2.1.7和SDN 3.2.2.RELEASE迁移到Neo4j 2.2.0和SDN 3.3.0.RELEASE
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
首先,没有Neo4jHelper
类...所以应该改用什么?
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)
,但在以前的版本中,一切正常(我的DAO和服务都用@Transactional
注释).
but on the previous versions everything work fine(My DAO and Services are annotated with @Transactional
).
如何在我的Spring Boot应用程序中为Neo4j配置适当的TX管理器?
How to configure appropriate TX manager for Neo4j in my Spring Boot application ?
现在使用NullTransactionManager
,我认为这是问题的原因:
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
我做错了什么?
推荐答案
这是正在进行的工作,我在分支中拥有它,但由于Neo4j 2.2更改了许多内部API,所以尚未完成.
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.
下一周左右继续关注.
这篇关于无法移至Neo4j 2.2.0和Spring Data Neo4j 3.3.0.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!