Spring transaction abstraction

So far, you have learned how to manage Hibernate transactions through JDBC (when Hibernate uses a single database) and through JTA (when Hibernate interacts with multiple databases). Spring can simplify transaction management in Hibernate applications by providing a transaction infrastructure to abstract the application code from the underlying transaction strategy. Using Spring, transaction management code that's bound to a specific API, such as JDBC or JTA, is omitted from the application. With Spring, you can manage transactions programmatically or declaratively. However, the declarative approach has certain advantages and is always preferred.

Transaction management with Spring is powerful and flexible because ...

Get Spring Persistence with Hibernate now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.