Re: Lingering connections
"R.F. Pels" <[email protected]>
| Newsgroups | gmane.comp.java.openjms.user |
|---|---|
| Message-ID | <[email protected]> |
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? > Alternatively, just call System.exit(). Which is exactly what I do NOT want to do. Sorry, the client also has other things to shut down properly. -- R.F. Pels, 3e Rompert 118, 5233 AL 's-Hertogenbosch, The Netherlands +31736414590 [email protected] http://home.tiscali.nl/~ruurd ------------------------------------------------------- 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