问题
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