简体   繁体   中英

Why are the connections not timing out?

Running my application on Websphere Application Server 7 with SQLServer 2008 database. When the SQLServer is at 100% every connection is hanging and filling up the connection pool. This leads to every thread also hanging. And after 10 minutes the log is filled with this:

00000042 ThreadMonitor W   WSVR0605W: Thread "WebContainer : 11" (00000049) has been active for 742352 milliseconds and may be hung.  There is/are 14 thread(s) in total in the server that may be hung.

The connection pool is using JTDS and has a timeout set to 300 sec.

I would pressume that after 300sec every connection whould throw an exception which would then make all the threads un-hang?

Why would the connection throw an exception after 300 seconds?. If the connection object is in use, it will continue to be alive.

Also specify the exact time out attribute that you are referring to?

Here is the definition for Connection Timeout :

This value indicates the number of seconds that a connection request waits when there are no connections available in the free pool and no new connections can be created. This usually occurs because the maximum value of connections in the particular connection pool has been reached.

For example, if Connection timeout is set to 300, and the maximum number of connections are all in use, the pool manager waits for 300 seconds for a physical connection to become available. If a physical connection is not available within this time, the pool manager initiates a ConnectionWaitTimeout exception.

So, it does not make 'all the threads un-hang', it only tells you after 300 secs that there were no free connections in the pool, so it can't give you one.

The parameter governing how long an transaction may stay active is called transaction timeout , after which the transaction is marked for rollback. But even this timeout does not cancel out the thread using the connection, it only marks it as rollback-only. In order to free connection you must use either use a third party tool (ITCAM can cancel any threads in the server), or terminate/drop connections from database side.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM