hezhou opened SPR-16764 and commented

JmsTemplate with sessionTransacted does not call rollback method when sending message error,maybe jms provider has received this message but network time out. But then users will use this session's producer to send a new message, and commit it, which will commit all the two message.   In this situation, users will be very confused about the first error message.

why JmsTemplate does cant call rollback when error , but auto call commit method when sending success.


Affects: 4.3.16

Issue Links: - #21306 Transaction session has not rollback,causing message chaos ("is duplicated by")

Comment From: spring-projects-issues

hezhou commented

so?

Comment From: snicoll

Unfortunately, it is very hard to help with the level of details that you've shared. The Javadoc for setSessionTransacted states that:

Setting this flag to "true" will use a short local JMS transaction when running outside a managed transaction, and a synchronized local JMS transaction in case of a managed transaction (other than an XA transaction) being present. This has the effect of a local JMS transaction being managed alongside the main transaction (which might be a native JDBC transaction), with the JMS transaction committing right after the main transaction.

If you can provide more details, we can reopen.