In a previous version (3.0.8), when a queue session tried to close and if a message was proccessing, the session waits until message was proccessed.
In a new version (3.2.5), this not happens. Queue session closes, and a message that is proccessing not finishs: when message is going to be acknowledged, session is already closed and an exception is thrown.
Is this a bug?
No. Sessions are not synchronized by spec.
If you want to guarantee the behaviour do
consumer.close() (or receiver/subscriber in jms1.0.2b)
then close the session.
This question has been asked before.