I've read in Hibernate documentation as well as Spring doc that HibernateTransactionManager has, at best, a limited support of the transaction timeouts.
about Transaction timeout in Hibernate doc:
in Spring (though this might come from an older version of the doc)Outside a managed (JTA) environment, Hibernate cannot fully provide this functionality. However, Hibernate can at least control data access operations, ensuring that database level deadlocks and queries with huge result sets are limited by a defined timeout. In a managed environment, Hibernate can delegate transaction timeout to JTA.
I'm quite unclear about whether the default timeout will be applied to at least what Hiberate doc calls "data access operations" if I use HibernateTemplate. It should according to the doc.Supports custom isolation levels, and timeouts that get applied as appropriate Hibernate query timeouts. To support the latter, application code must either use HibernateTemplate (which by default applies the timeouts) or call SessionFactoryUtils.applyTransactionTimeout for each created Hibernate Query object.
We have timeouts problem with our application, and I just switched to using HibernateTemplate instead of my own template.
Do you think that was a sufficient reason to have no timeout applied before? Will the switch to using HibernateTemplate be enough to enable it?
What would be the cost to using JtaTransactionManager instea of HibernateTransactionManager?
What could possibly be transactions that are not data access operations???


Reply With Quote
