RE: Lingering connections

"Tim Anderson" <[email protected]>
Newsgroups gmane.comp.java.openjms.user
Message-ID <[email protected]>
> From: R.F. Pels
> 
> All,
> 
> Is there a way to solve the problem of the connections being 
> kept open in OpenJMS 0.7.7? If I implement a client program 
> with it, those clients won't stop in the regular way because 
> the thread that maintains the connections to the JMS server 
> isn't going away.
> 

Physical connections to the server are shared across javax.jms.Connection
and javax.naming.Context instances, and are only closed when the last
reference to them is removed. In other words, the physical connection
won't disappear until the garbage collector:
. has decided that nothing is referencing it; and
. run finalizers

If you call System.gc() this should clean up any physical connections,
providing you have closed Connection and Context instances.
Alternatively, just call System.exit().

-Tim



-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.