users@glassfish.java.net

Re: Maxing out Connection Pools

From: Jagadish Prasath Ramu <Jagadish.Ramu_at_Sun.COM>
Date: Tue, 10 Apr 2007 08:29:27 +0530

Hi Jason,
You can use "connection-leak-tracing" feature in GF V2 by setting
"connection-leak-timeout-in-seconds" value, eg: 180. Once the specified
period expires, stack trace of the thread that requested the connection
will be logged in server.log. This will help to find the application
code that is not closing the connections.

Thanks,
-Jagadish

On Mon, 2007-04-09 at 14:55 -0500, Jason Lee wrote:
> We have an issue on our production server where we're maxing out a
> particular connection pool (which connects to SQL Server, fwiw). If I
> look at the DB server, I can see all 128* connections, some of them
> showing that they connected several hours earlier. I would think that
> the connection should idle out and be removed, but that does not
> appear to be happening. One of the frustrating things is that we have
> no way (that we know of) of killing the connections from the GlassFish
> side other than restart the server, nor do we know how to tell which
> applications have the connection. Sadly, we have several JDBC
> resources pointing at the same pool, so we've done a bit of this to
> ourselves, but that's another issue for us. :P
>
> Is there a way to reset/close all connections for a given pool? Is
> there a way to figure out who the offending applications are so we can
> try to fix them? Restarting is a bit jarring for our users. :P
>
> Thanks!
>
> -----
> Jason Lee, SCJP
> Senior Software Engineer
> http://www.iec-okc.com
>