users@glassfish.java.net

Re: Message beans and connection limit

From: <glassfish_at_javadesktop.org>
Date: Sun, 25 Jan 2009 23:02:19 PST

In addition to what I've wrote earlier in some other thread (see below), You must check also Your JMS client code for proper connection/session/object closure, especially when using C client.

========================================================================
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=328094