In 'Hibernate In Action' page 50 (and also in documentation) it is written that:
"Set the factory class for the Hibernate Transaction API to JTA as described earlier, and declare the transaction manager lookup specific to your application server. The lookup strategy is required only if you use the second-level caching system in Hibernate, but it doesn’t hurt to set it even without using the cache."
We understood that it is only necessary to write:
Code:
hibernate.transaction.factory_class = net.sf.hibernate.transaction.JTATransactionFactory
in hibernate.properties file.
But if you write only factory_class property and don't write the name of transactionmanagerlookup class in properties file hibernate JBoss throws an exception which says "Could not find UserTransaction in JNDI". Because default jta.UserTransaction is not applicable to JBoss. According to the code (JTATransactionFactory class) Hibernate cannot find the real usertransaction name if you don't mention it explicitly.
According to these,
is this statement true?
If we want to use container-managed transaction demarcation we have to give both transaction.factory_class and transaction.manager_lookup_class.
If it is true there is something wrong in the documentation.
Hibernate version: 2.1.6