问题描述
我想集成 Spring 和 Hibernate ,并使用 JTA 管理事务。我也想把事务处理委托给App服务器,在我的例子中是JBoss。我有一个关于Spring中 transactionManager bean配置的查询:
$ b 我们可以使用 HibernateTransactionManager 并在hibernate.properties文件中设置属性 hibernate.transaction.factory_class 和 hibernate.transaction.manager_lookup_class ?
如果没有,为什么?
或者,我们是否应该使用 JTATransactionManager ?
在选项(2)中,是否还需要在中设置属性(hibernate.transaction.factory_class,hibernate.transaction.manager_lookup_class) hibernate.properties ?
谢谢。
如果你想委托给应用服务器,你必须使用JTATransactionManager,据我所知,HibernateTransactionManager不是JTA事务管理器。
I want to Integrate Spring and Hibernate and use JTA for managing the transactions. I would also like to delegate transaction handling to the App server, which in my case is JBoss. I have a query regarding the configuration of the "transactionManager" bean in Spring:
1) Can we use HibernateTransactionManager and set the the properties hibernate.transaction.factory_class and hibernate.transaction.manager_lookup_class in hibernate.properties file?If not, why?
2) Or, should we use JTATransactionManager?
In option (2), do we still need to set the properties("hibernate.transaction.factory_class", "hibernate.transaction.manager_lookup_class") in hibernate.properties?
Thanks.
If you want to delegate to the appserver, you have to use JTATransactionManager to my knowledge, HibernateTransactionManager is not a JTA transaction manager.
这篇关于Spring + Hibernate + JTA - HibernateTransactionManager或JTATransactionManager的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!