persistence-unit, different hibernate.transaction.manager_lookup_class property

五迷三道 提交于 2020-03-03 06:05:46

问题


I have Java EE application, and my EJB module have persistence.xml.

I deploy my app on 3 app servers: JBoss, GlassFish and WebLogic, and every server needs own hibernate.transaction.manager_lookup_class property.
WL needs

<property name="transaction.manager_lookup_class" value="org.hibernate.transaction.WeblogicTransactionManagerLookup" /> 

JBoss needs

<property name="transaction.manager_lookup_class" value="org.hibernate.transaction.JBossTransactionManagerLookup" />  

Glass fish

<property name="transaction.manager_lookup_class"    
value="org.hibernate.transaction.SunONETransactionManagerLookup" />  

What is the best way to do this?


回答1:


Solution is use

<property name="hibernate.transaction.factory_class" value="org.hibernate.transaction.JTATransactionFactory"/>  

instead of

<property name="transaction.manager_lookup_class"


来源:https://stackoverflow.com/questions/10897015/persistence-unit-different-hibernate-transaction-manager-lookup-class-property

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!