Table of Contents

What is Atomicity ? (Transaction|Action)

About

An atomic action is one that effectively happens all at once.

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:

Domain

Transaction

In the context of a transaction , 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).

This functionality is known as atomic commit.

Code

See Data Concurrency - Atomic Variable Access

File System

A file deletion should be atomic.

If a request to delete a file is send to the file system and the power is lost during the delete operation, once power is restored either:

If after power is restored the file is only partially deleted, if some of its data has been altered or erased, or the file has been truncated but not completely removed, then data corruption/inconsistency will likely result.

Documentation / Reference