Hello, guys.
We have a web application Ejb 2.1 / Hibernate.
Before all our transactions were managed by a Container (CMT).
Thus in our hibernate.properties file we specified CMTTransactionFactory.
hibernate.transaction.factory_class=org.hibernate.transaction.CMTTransactionFactory
Recently we required in one BMT usage (bean, where transactions are managed by Transaction API (UserTransaction interface)).
We wonder if we should switch our configuration in hibernate.properties to
hibernate.transaction.factory_class=org.hibernate.transaction.JTATransactionFactory
In manuals and books there are written:
"The CMTTransactionFactory
should be enabled if you’re working with JTA and EJBs, and if you plan to set transaction
boundaries declaratively on your managed EJB components—in other
words, if you deploy your EJB application on a Java EE application server but don’t
set transaction boundaries programmatically with the UserTransaction interface
in application code." (c) Hibernate in Action
But in EJBContext there is getUserTransaction() method. And it works fine with specified CMTTransactionFactory. What possible issues we can get using CMTTransactionFactory together with explicitly usage of Transaction API (getUserTransaction()).
Should we switch our configuration to JTATransactionFactory"?
If thus, will we loose in performance in comparing with CMTTransactionFactory?
Guys, could you provide detail answer?
Many thanks.
|