Gowtham
Gowtham

Reputation: 1507

Global Transaction Timeout for Spring HibernateTransactionManager

I am using Spring's HibernateTransactionManager to manage my transactions using annotations. It looks like timeout values can be set on annotations, but i dont see how to set them globally for the whole application and then override on the annotation on a need basis.

Here is my configuration

<bean id="txManager"     class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory" ref="sessionFactory" />
</bean>

<tx:annotation-driven transaction-manager="txManager"/>

Any ideas? thanks for the help.

Upvotes: 1

Views: 3743

Answers (1)

axtavt
axtavt

Reputation: 242686

HibernateTransactionManager.setDefaultTimeout():

<bean id="txManager"     class="org.springframework.orm.hibernate3.HibernateTransactionManager">
    <property name = "defaultTimeout" value = "value in milliseconds" />
    <property name="sessionFactory" ref="sessionFactory" />
</bean> 

Upvotes: 4

Related Questions