Feb 26th, 2009, 03:29 AM
Strange behavior of JmsTransactionManager
I have been testing the rollback of a transactional JMS producer and manually throw an exception from the method that declared transactional. I expected that if an exception is thrown, the message will *NOT* be sent to the queue. Here is my finding:
1. If javax.jms.JMSException is thrown, the transaction is commited.
2. If the javax.jms.JMSException is converted by convertJmsAccessException(e) first, the transaction is rollback!!
Point 2 should be the expected behavior. Does it mean that JmsTransactionManager could only rollback runtime exception (to be specific, the exception thrown is org.springframework.jms.UncategorizedJmsException) . Any idea?
Thanks for your time.