Re: Session closed suddenly
Jyrki Saarinen <[email protected]>
| Newsgroups | gmane.comp.java.openjms.user |
|---|---|
| Message-ID | <[email protected]> |
Tim Anderson wrote:
>There are a couple of possibilities:
>. someone is invoking close() on the Connection
> that owns the Session
>. the physical connection to the server has been lost.
> This forces closure of the Sessions attached to the Connection
>
> You can verify if this is the case by registering
> an exception listener with the connection e.g.:
>
> connection.setExceptionListener(new ExceptionListener() {
> public void onException(JMSException exception) {
> exception.printStackTrace();
> }
> };
>
Does anyone know whether this pattern of having Session object alive for a long time OK? Or should I create a new Session object every time when I want to publish a message and then close the Session?
Jyrki
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click