Chapter 9. Transactions

This chapter explains transactions and a somewhat related topic, locking. Both of these features require database support, but are critical for ensuring data integrity.

Introduction to Transactions

A transaction is a mechanism for grouping a set of statements together as a unit. A transaction should be atomic, consistent, independent, and durable (ACID). Depending on the application, this capability can be extremely important.

As an example of the importance of a transaction's ACID properties, consider the elements of a bank transaction. Let's say that you wish to move money from a checking account into a savings account, using the conceptual tasks:

  • Verify that checking account has more than $100.

  • Remove $100 from checking account. ...

Get Hibernate: A J2EE™ Developer's Guide 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.