Hibernate 带有JTA数据源的DeltaSpike
有人尝试过使用Apache的DeltaSpike在Jetty中设置事务性吗? 我有一个webapp,我正试图在Jetty中运行,它使用CDI并具有JTA数据源。我的事务管理器未被注入,它为null,因此导致错误。我包括了deltaspike jpa jar,并按照下面给出的链接中的说明进行了操作,但到目前为止它还不能工作。当我在hibernate类中进行深层调试时,我可以看到我的配置默认为NOJTAPlatform,就好像没有配置JTA一样 任何想法都将不胜感激Hibernate 带有JTA数据源的DeltaSpike,hibernate,jpa,cdi,jta,deltaspike,Hibernate,Jpa,Cdi,Jta,Deltaspike,有人尝试过使用Apache的DeltaSpike在Jetty中设置事务性吗? 我有一个webapp,我正试图在Jetty中运行,它使用CDI并具有JTA数据源。我的事务管理器未被注入,它为null,因此导致错误。我包括了deltaspike jpa jar,并按照下面给出的链接中的说明进行了操作,但到目前为止它还不能工作。当我在hibernate类中进行深层调试时,我可以看到我的配置默认为NOJTAPlatform,就好像没有配置JTA一样 任何想法都将不胜感激 <dependen
<dependency>
<groupId>org.apache.deltaspike.modules</groupId>
<artifactId>deltaspike-jpa-module-impl</artifactId>
<version>0.5</version>
</dependency>
persistence.xml中指定的我的数据源:
<persistence-unit name="database" transaction-type="JTA">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<jta-data-source>jdbc/myDS</jta-data-source>
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect"/>
<property name="hibernate.archive.autodetection" value="class"/>
<property name="hibernate.id.new_generator_mappings" value="true"/>
</properties>
</persistence-unit>
org.hibernate.ejb.HibernatePersistence
jdbc/myDS
您在Jetty中使用哪种CDI实现,配置是否正确
通过尝试一些简单的注入,确保通用CDI注入工作正常
确保包含核心增量峰值依赖项deltaspike core api和deltaspike core impl
根据设置CDI的方式,您可能还需要deltaspike cdictrl api和特定的cdictrl api
更多信息,请访问您正在使用哪个JTA提供商,以及如何将其集成到中?只要它使UserTransaction在标准JNDI位置可用,一切都应该正常工作。
<persistence-unit name="database" transaction-type="JTA">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<jta-data-source>jdbc/myDS</jta-data-source>
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect"/>
<property name="hibernate.archive.autodetection" value="class"/>
<property name="hibernate.id.new_generator_mappings" value="true"/>
</properties>
</persistence-unit>