Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Abandoned
-
5.10.0
-
None
-
None
-
Windows, Glassfish 3.1.2.2 with AMQ RAR, ActiveMQ 5.10.0 running standalone.
Description
When a Glassfish server is going down, messages being currently delivered to a MDB, are acknowledged with the following message coming from org.apache.activemq.ra.ServerSessionImpl:
Local transaction had not been commited. Commiting now.
Having analyzed the problem, we discovered, that when Glassfish is going down the method endpoint#beforeDelivery (org.apache.activemq.ra.ServerSessionImpl#beforeDelivery) does not start an XA transaction. So ActiveMQ starts a local transaction in org.apache.activemq.ActiveMQSession#doStartTransaction. After that ActiveMQSession#run tries to call messageListener.onMessage() and it fails with an exception. Exception is handled in ActiveMQSession#run, but is not propagated to org.apache.activemq.ra.ServerSessionImpl#afterDelivery. And in org.apache.activemq.ra.ServerSessionImpl#afterDelivery there is finally {} clause, which commits the session if there is local transaction (and there is one - see above) despite the exception occurred before.
This last commit seems to be inappropriate. In case of a transaction (local or not) the corresponding message may not be acknowledged - it must be rollbacked (no session commit).