Transactions

A transaction is a sequence of indivisible Data Definition Language (DML) requests. Applications access a database via transactions.

Concurrency Issues

When multiple applications access the same data, undesirable results can occur. An application programmer may assume exclusive access to the database within a transaction. The Database Management Systemschedules Data Manipulation Language requests from all transactions in such a way that guarantees data integrity.

ACID Properties of a Transaction

  • Atomicity: A transaction occurs entirely, or not at all.
  • Consistency: Each transaction preserves the consistency of the database.
  • Isolation: Concurrent transactions do not interfere with each other.
  • Durability: Once completed, a transaction’s changes are permanent.

Concepts

  • Atomicity
    • When a transaction is treated as a single operation, meaning that it is either fully completed or not. If it fails halfway, the entire transaction is rolled back.
  • Consistency
  • Isolation
  • Durability