Data - (Transaction|Action) Atomicity

> (Data|State) Management and Processing > Data Properties and Transactions

1 - About

Either all the tasks in a transaction must happen, or none of them. The transaction must be completed, or else it must be undone (rolled back).

A transaction groups task (such as SQL statements) so that they are either all committed, which means they are applied to the data, or all rolled back, which means they are undone from the data.

In database systems, atomicity (or atomicness) is one of the ACID transaction properties. In an atomic transaction, a series of database operations either all occur, or nothing occurs.

In programming, an atomic action is one that effectively happens all at once. An atomic action cannot stop in the middle: it either happens completely, or it doesn't happen at all. No side effects of an atomic action are visible until the action is complete.

The implementation of atomicity is done through a rollback journal.

Advertising

3 - Example

An example of atomicity is ordering an airline ticket where two actions are required: payment, and a seat reservation. The potential passenger must either:

  • both pay for and reserve a seat; OR
  • neither pay for nor reserve a seat.

4 - Documentation / Reference