|
From: Michael E. M. <mm...@re...> - 2005-04-25 20:41:55
|
In HIbernate3 HibernateTemplate.java I see only two places where
SessionFactoryUtils.applyTransactionTimeout()
is being called..
Am I correct that it's called only with queries, and not
inserts/updates????????
(ie; prepareQuery() and prepareCriteria()).
HibernateTemplate.java:
protected void prepareQuery(Query queryObject) {
if (isCacheQueries()) {
queryObject.setCacheable(true);
if (getQueryCacheRegion() != null) {
queryObject.setCacheRegion(getQueryCacheRegion());
}
}
SessionFactoryUtils.applyTransactionTimeout(queryObject,
getSessionFactory());
}
I have been trying to debug why transaction timeout exceptions are not
being thrown when they should.
(setting a timeout value in a
org.springframework.transaction.interceptor.TransactionProxyFactoryBean
config entry)
<bean id="orderService"
class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
<property name="target"><ref local="orderServiceTarget"/></property>
<property name="transactionManager">
<ref bean="transactionManager"/>
</property>
<property name="transactionAttributes">
<props>
<prop key="validateOrder">PROPAGATION_SUPPORTS,
timeout_5, readOnly</prop>
<prop key="captureOrder">PROPAGATION_REQUIRED,
timeout_5, +CanopicException</prop>
</props>
</property>
</bean>
|