This content has been marked as final.
Show 2 replies
-
1. Re: Clarification on multiple threads and sessions
timfox Nov 7, 2005 3:39 PM (in response to timfox)Ignore me.
I've found the part of the spec that deals with this (4.4.6)
:) -
2. Re: Clarification on multiple threads and sessions
adrian.brock Nov 7, 2005 3:44 PM (in response to timfox)To give the answer (although this is an FAQ :-)
"timfox" wrote:
Is the above code illegal JMS client code?
NO.
If so, should we throw exceptions to the user if they attempt to do anything with a session (other than close()) after a message listener has been set on one of it's consumers?
In some places it should throw an exception. e.g. trying to receive on a consumer
that has a message listener.
In general, the session is not thread safe and it is "caveat emptor".
If the user does not use it correctly it should not break the jms server.
It will almost certainly break their application, e.g. acknowledging unprocessed
messages or vice versa.