From the course: Spring: Messaging with JMS

Unlock the full course today

Join today to access over 24,900 courses taught by industry experts.

Transaction management with Spring JMS (transactions)

Transaction management with Spring JMS (transactions) - Spring Tutorial

From the course: Spring: Messaging with JMS

Transaction management with Spring JMS (transactions)

- [Instructor] Transaction management is a nice feature that Spring makes available out of the box for automatically committing, or rolling back transactions if they fail. Spring makes available several implementations of the platform transaction manager interface for handling transactions across JDBC, JBA, Hibernate, JMS and more. We'll be using the JMS transaction manager in this video. Let's quickly add some transaction management to our course project. Opening back up our JMS config.java class we're going to add a new Spring Bean annotation. We'll type @bean public platform transaction manager. And we'll call this method our JMS transaction manager. Inside of it, the method we'll return a new JMS transaction manager. And we'll supply it, our connection factory method. Now for JMS transactions there really are only two things that can happen on rollback. For a send on rollback the message is not sent. For a receive however the message is re-queued for retrieval again on the MOM…

Contents