11 Transactions and concurrency

This chapter covers

  • Defining database and system transaction essentials
  • Controlling concurrent access with Hibernate and JPA
  • Using non-transactional data access
  • Managing transactions with Spring and Spring Data

In this chapter, we’ll finally talk about transactions: how we create and control concurrent units of work in an application. A unit of work is an atomic group of operations, and transactions allow us to set unit of work boundaries and help us isolate one unit of work from another. In a multiuser application, we may also be processing these units of work concurrently.

To handle concurrency, we’ll first focus on units of work at the lowest level: database and system transactions. You’ll learn the APIs for ...

Get Java Persistence with Spring Data and Hibernate now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.