在Websphere上使用JPA/Hibernate时不支持操作异常
问题 尝试更新数据库中的记录时,我遇到以下异常:在Websphere上使用JPA/Hibernate时不支持操作异常,hibernate,jpa,websphere,jta,myeclipse,Hibernate,Jpa,Websphere,Jta,Myeclipse,问题 尝试更新数据库中的记录时,我遇到以下异常: java.lang.UnsupportedOperationException at org.hibernate.service.jta.platform.internal.WebSphereExtendedJtaPlatform$TransactionManagerAdapter.setRollbackOnly(WebSphereExtendedJtaPlatform.java:139).... 此异常仅在更新时发生。创建、阅读和删除工作 抛
java.lang.UnsupportedOperationException
at org.hibernate.service.jta.platform.internal.WebSphereExtendedJtaPlatform$TransactionManagerAdapter.setRollbackOnly(WebSphereExtendedJtaPlatform.java:139)....
此异常仅在更新时发生。创建、阅读和删除工作
抛出此代码的典型原因是什么
奇怪的扭曲
我们需要使用MyEclipseBlue,并且Maven或ant不用于构建项目;只能使用MyEclipseBlue的构建过程。测试MyEclipseBlue生成的EAR时会抛出上述错误。当我将代码部署为Maven在命令行上生成的EAR时,不会抛出上述异常
我费了很大的劲来验证生成的战争是相同的,但很明显,我遗漏了一些东西
环境
- Websphere 8.5.5
- MyEclipse蓝色v10.x
- Windows 7 x64
<property name="hibernate.transaction.jta.platform"
value="org.hibernate.service.jta.platform.internal.WebSphereJtaPlatform" />
似乎有效
请注意,这使用的是WebSphereJtaPlatform
,而不是WebSphereExtendedJtaPlatform
在hibernate 4.3中尝试:
<property name="hibernate.transaction.jta.platform"
value="org.hibernate.service.jta.platform.internal.WebSphereJtaPlatform" />
似乎有效
请注意,这使用的是
WebSphereJtaPlatform
,而不是WebSphereExtendedJtaPlatform
你有没有试过解开罐子并比较里面的东西?可能是重复的?你有没有试过解开罐子并比较里面的东西?可能是重复的
<property name="hibernate.transaction.jta.platform"
value="org.hibernate.service.jta.platform.internal.WebSphereJtaPlatform" />