Hi!
I had the same problem. I found a simple solution without patching Spring. Just use the JmsTransactionManager (for your connection, if not already configured) and TX-annotations:
Code:
<bean id="jmsTransactionManager"
class="org.springframework.jms.connection.JmsTransactionManager">
<property name="connectionFactory" ref="connectionFactory"/>
</bean>
<tx:annotation-driven transaction-manager="jmsTransactionManager"/>
Then just write a bean wrapping your sync sender methods and annotate these methods:
Code:
@Transactional(propagation = Propagation.NOT_SUPPORTED)
public ... sendSync(...) {
...
jmsTemplate.convertAndSend(...)
jmsTemplate.receiveSelectedAndConvert(...)
...
Hope this helps.
But nevertheless maybe it is good idea if the spring framework would directly provide such a sendSync method in its JmsTemplate.
Bye, Torsten