users@glassfish.java.net

Re: Simple JMS Client doesn't quit

From: <glassfish_at_javadesktop.org>
Date: Mon, 25 Feb 2008 07:50:14 PST

There are certain daemon threads associated with a jms connection, since the
connection factory that is looked up is a managed connection factory (belongs to
jms resource adaptor), and the connections are obtained and returned from/to a
connection pool, a connection.close will not actually close the underlying
ohysical connection but only return it to the pool. So the threads that were
created for this connections are also alive as long as the connecion is kept
alive in the pool. And there are specific reasons why these threads have to be
daemon threads and not user threads.
Because of the above reasons the client program hangs, waiting indefinitely (or
until the idle time out in the pool is exhausted) for the threads to exit.

As a workaround we need to configure the connection pool (used by the connector
resource) in such a way that it does not pool connections (closes them
immediately instead of pooling it).
This can be achieved by setting the following pool properties in GlassFish V2


steady-pool-size=0
max-connection-usage-count=1
pool-resize-quantity=1
idle-timeout-in-seconds=5 ( the lesser the better because the connnections will
be closed after this time)

Please use asadmin set --user <user> --passwordfile <file>
domain.resources.connector-connection-pool.<poolname>.<property>=<value>
[Message sent by forum member 'rampsarathy' (rampsarathy)]

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