users@glassfish.java.net

Re: Problem allocating db connection - max connections in use

From: <glassfish_at_javadesktop.org>
Date: Fri, 05 Dec 2008 08:05:35 PST

Usually those "max connections in use" are first indicators of memory leaks in Java EE application, especially when using MDB/JMS. I'd check if all Connection, Session, MessageProducer objects are released (closed) when done working with them (for example in MDBs @PreDestroy method). If they are not released, Message Queue server is holding and not releasing a connection in glassfish JDBC pool and at some point application will run out of them. Another indicator for leaks in MQ (code) is increasing PSOldGen values while monitoring garbage collection for Your appserver.

In case the code looks fine, and memory usage for MQ server is fine, try increasing max-pool-size, which will resolve that problem. Otherwise You'll get the same error again, only application will run a while longer (it will run out of connections anyway).

/mareks
[Message sent by forum member 'mareks' (mareks)]

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