Spring Transaction Manager Scheduler

Go To StackoverFlow.com

0

Good time!

Does the Spring's transaction manager uses some kind of scheduler to invalidate transactions on timeout (if so, what is the scheduler's check period?) or there is another mechanism?

2012-04-05 17:10
by Dmitry


2

Nope, the timeout is checked against only at database interaction, there is no separate thread to enforce it. As a consequence stalled connection won't be released and the timeout exception can occur long time after actual deadline.

If you want to make sure connections are not stuck this way, use connection pool features like c3p0's unreturnedConnectionTimeout or bonecp's closeConnectionWatch.

2012-04-05 18:58
by mrembisz
Thank you for the answer!! - Dmitry 2012-04-06 06:43


0

From the Spring 3.0 docs:

The transaction timeout defaults to the default timeout of the underlying transaction system, or or none if timeouts are not supported

This applies to both the @Transactional annotation and the <tx:advice> point cut.

2012-04-05 18:49
by Ranga
Thank you for the answe - Dmitry 2012-04-06 06:43
Ads