7.1. Transactions

A transaction is a grouping together of work – typically changes to persistent data – that must be completed in its entirety or not at all. The fundamental aim of a transaction is to ensure that partial completion, where some data changes persist in the data store and others in the same transaction don’t, does not occur. This so-called atomic property of transactions is integral to the maintenance of data integrity.

Another fundamental property of transactions is that they must be isolated, to a given degree, from each other. Isolation levels dictate the consistency with which data, being manipulated in one transaction, is presented, in the context of another transaction.

Experienced database programmers will be familiar with ...

Get Java™ Data Objects 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.