RE: Lingering connections

"Tim Anderson" <[email protected]>
Newsgroups gmane.comp.java.openjms.user
Message-ID <[email protected]>
> From: R.F. Pels
> 
> On Sunday 21 August 2005 15.20, Tim Anderson wrote:
> 
> > 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.
> 
> Are you telling me that I cannot reliably shut down a program 
> that uses a JMS 
> server? And that connections are kept open regardless of the 
> fact that all 
> connections are closed? I mean, this leads to totally 
> indeterminate behaviour 
> in a program that uses OpenJMS. As a user, I don't have any 
> influence over 
> the garbage collector in the first place and as a programmer, 
> I cannot 
> reliably shut down the connection at a time I deem 
> appropriate. Surely there 
> is a better solution than that?

That's how it presently works in the 0.7.7 alpha. If you'd like
the behaviour changed, you could always help out - the relevant 
code can be found here:
 
http://openjms.sourceforge.net/modules/openjms-net/xref/org/exolab/jms/net/c
onnector/DefaultConnectionPool.html
Connections are cleaned up by the inner Reaper class.

-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.