Skip to main content

Abstract

In this chapter, you’ve learned both the fundamentals and low-level details for managing database transactions with Spring. We’ve explored two different avenues for applying transactions declaratively with Spring: via annotation and through XML-based Spring configuration. It’s also possible to utilize Spring’s transaction management programmatically, through the use of the TransactionTemplate. However this approach couples transactional behavior with the application’s business logic.

Understanding how transactions work, along with the available configuration options, is critical for developing and debugging multiuser applications. We’ve discussed both simple and complex scenarios in this chapter, and we hope they give you a taste of what’s possible when using Spring for transaction management.

Most important, Spring provides a consistent approach for applying transactional semantics to an application, no matter what the architecture or environment. This means that you can configure and code your application the same way, regardless of whether you’re deploying to a JEE app server using a JTA datasource or to a lightweight container with a local datasource. The difference is just a matter of configuration.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 34.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 44.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

Authors

Editor information

Steve Anglin Tom Welsh Mark Beckner Ewan Buckingham Gary Cornell Jonathan Gennick Jonathan Hassell Michelle Lowman Matthew Moodie Duncan Parkes Jeffrey Pepper Frank Pohlmann Douglas Pundick Ben Renow-Clarke Dominic Shakeshaft Matt Wade Mary Tobin Marilyn Smith

Rights and permissions

Reprints and permissions

Copyright information

© 2010 Paul Tepper Fisher and Brian D. Murphy

About this chapter

Cite this chapter

Fisher, P.T., Murphy, B.D. (2010). Transaction Management. In: Anglin, S., et al. Spring Persistence with Hibernate. Apress. https://doi.org/10.1007/978-1-4302-2633-8_7

Download citation

Publish with us

Policies and ethics