This content has been marked as final. Show 2 replies
I've found the part of the spec that deals with this (4.4.6)
To give the answer (although this is an FAQ :-)
Is the above code illegal JMS client code?
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.