I am trying to create a MDB which uses spring-managed hibernate in the course of processing a message. I would like to have the entire process wrapped in a transaction so that if the processing fails, the message is not received and will be resent.
So I originally set my MDB to have Container-managed transactions and I configured the spring JtaTransactionManager just as I had in my web layer. The result was that the bean blew up on initialization because the java:comp/UserTransaction was not available during ejbCreate().
OK, so now I am thinking that that was a bad idea -- I don't need the JtaTransactionManager if I have Container managed transactions. Of course the container didn't make the UserTransaction available, I did not ask it to.
So my current approach is to NOT configure a transaction manager via Spring, but just use the container managed transactions. Is this approach in the sense that it will accomplish what I want? Even if it is correct, is there a better Spring-oriented approach?
Thanks,
Ray


Reply With Quote
