Hibernate 4.3.x是否支持JTA 1.1?

3
Hibernate 4.3.x的maven依赖为JTA 1.2。由于许可证原因,我们更愿意使用来自Geronimo的JTA 1.1。
然而,我无法找到任何明确的迹象表明JTA 1.1是否与Hibernate 4.3.x兼容。我看到在Hibernate 5.x中,该依赖关系已经改回了JTA 1.1。
有人能否确认Hibernate 4.3.x是否与JTA 1.1兼容?

如果您使用Geronimo,就不需要Hibernate,因为Geronimo使用OpenJPA。 - Mr_Thorynque
我们只想使用Geronimo JTA实现,不使用Geronimo本身。 - Mark
我也做了一些奇怪的混合。但像Geronimo、Wildfy这样的项目的目标是提供一个完整的堆栈测试。将一个东西的一些东西混合到另一个东西中并不是微不足道的。但正如@spandlerb所回答的那样,您可以使用JTA 1.1依赖项构建自己的Hibernate版本。或者只需在您的pom中排除JTA 1.2依赖项并明确获取JTA 1.1...并进行大量测试。 - Mr_Thorynque
1个回答

2
我能找到的最好的东西是从 build.gradle 文件中提取的代码片段,在此处找到。 它适用于 4.3.11.final 版本,并且看起来像是一个解决方法。如果你当前使用的版本没有这个解决方法,你可以尝试添加它。
instruction 'Import-Package',
                // Temporarily support JTA 1.1 -- Karaf and other frameworks still
                // use it.  Without this, the plugin generates [1.2,2).
                'javax.transaction;version="[1.1,2)"',
                // Tell Gradle OSGi to still dynamically import the other packages.
                // IMPORTANT: Do not include the * in the modules' .gradle files.
                // If it exists more than once, the manifest will physically contain a *.
                '*'

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接