users@glassfish.java.net

Full connection pool? looks like getConnection hangs

From: <glassfish_at_javadesktop.org>
Date: Mon, 12 Apr 2010 08:47:27 PDT

Hello,
I am using GlassFish Enterprise Server v2.1 Patch01.
A few days ago we modified a few parameters in a production environment and we got this error an hour after:
2010-04-01T12:13:38.048+0200 [...] ThreadID=30 [...] Error in allocating a connection. Cause: In-use connections equal max-pool-size and expired max-wait-time. Cannot allocate more connections.
This error refers to an Oracle pool which is configured with 2 connections. This pool has never had this problem before. A few minutes before that, we got:
2010-04-01T12:11:53.014+0200 [...] ThreadID=47 [...] before getConnection
2010-04-01T12:12:19.146+0200 [...] ThreadID=18 [...] before getConnection
the "before getConnection" is a log message from our app which is printed just before calling getConnection on the pool.
Both ThreadID = 47 and 18 never printed the corresponding "after getConnection" which our app prints immediately after getConnection returns.
Therefore it looks like both threadID = 47 and 18 got stuck on getConnection and exhausted the pool (which has 2 connections). Then threadID = 30 asked for a new connection:
2010-04-01T12:13:36.039+0200 [...] ThreadID=30 [...] before getConnection
this getConnection correctly timed out after 2 minutes (our max-wait-time) and printed the above error at 2010-04-01T12:13:38.048+0200
I can't understand what went wrong. Both ThreadID = 47 and 18 got stuck forever on getConnection and never timed out.

By the way, the parameters that were changed before the error happened are:
1. we introduced LoginTimeout=1 (there was no LoginTimeout before)
2. we unchecked "on errors close all connections" (it was checked before)

After the problem we reverted to the previous values and everything is working fine again.

Bye,
Federico
[Message sent by forum member 'federicocozzi']

http://forums.java.net/jive/thread.jspa?messageID=396522