View Full Version : No exception thrown on transaction timeout using Resin DB connection pool

02-24-2011, 02:40 PM
We've recently moved to using Resin's DB connection pool. I've set the transaction-timeout in resin.conf to 1 minute. However, when I simulate a long running transaction any other waiting transaction does not throw an exception when the timeout has been exceeded.

Instead what I see for the waiting transaction when the long running transaction completes is a

javax.transaction.RollbackException: Transaction has been marked rolled back.

Is there anyway for the DB connection pool to be configured to throw an exception on timeout?

What we're seeing is a lot of connections that are never timing out.

We're using Resin 3.1.9 Pro, DB SQL Server 2005, JTDS SQL Driver.

Any help would be gratefully appreciated.


02-28-2011, 04:40 PM
I've marked this as a bug to look into, but it's not clear that it's a Resin bug.

The current behavior is to use that parameter to call the XAResource.setTransactionTimeout of the database resource. So it's the JDBC driver that would be throwing any timeout.

In other words, that configuration parameter doesn't add extra functionality, it's just a configuration mechanism for the connection.

The JDBC Statement has a Statement.setQueryTimeout() which might be more what you're looking for.