Feb 12th, 2006, 08:54 AM
JMS, Jencks and transactions
I want to use JMS via Jencks. My connection factory uses Jencks' org.jencks.factory.ConnectionManagerFactoryBean, with its pooling support, and transaction support. I configured the Jencks connectionManager with org.jencks.factory.LocalTransactionFactoryBean as its transactionSupport, since I don't think I will need distributed transactions.
Now, I would like to implement a JMS producer based on Spring's JmsTemplate, and I want the session to be transactional. It seems only reasonable to use Spring's JmsTransactionManager, and use an AOP proxy on top of a Pojo service. I can then have a single method of that service call jmsTemplate.send() several times, and the AOP proxy will issue a commit() when the method returns.
The way I understand this, the Jencks transactionManager will commit (or rollback) when the Spring transactionManager tells it to. The spring transactionManager, on the other hand, is oblivious to the fact that there is a second transactionManager underneath it... and all is well.
Is this making any sense?
Or am I missing anything particularily nasty here...
Oh, and another thing: The JmsTemplate javadoc states: "Note that transaction synchronization isn't supported for multiple concurrent transactions by different transaction managers. Only one transaction manager is allowed to activate it at any time". What does it mean?
I also have a Spring HibernateTransactionManager in my application. Is this going to be a problem?
Thanks in advance.