What is the proper way to manage JMS connections and sessions?
Should I always create a connection, create a session, DO THE WORK, then close the
session, and the connection. Or, can I keep the connection and session open indefinitely
and simply re-use them for as long as I want.
We've been trying to go with the re-use the session approach and for the most part, it
works. It seems, however, that if the queue goes away (eg. if jboss is restarted), the
client session running on a remote machine, never sees the queue go away or doesn't
receive any sort of exception. So, when the queue does come back online, it appears that
the session is disconnected and doesn't know it. It never resumes retrieving messages
from the queue.
I've looked around at many tutorials, but they all show the simplistic approach of
creating a new connection and session each time. Does JBoss have a recommended method? Is
it inappropriate to re-use the connection and session?
View the original post :
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4255619#...
Reply to the post :
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&a...