Introduction
A transaction is a unit of program execution that reads and possibly updates database items and must behave as one indivisible step: either all of its effects persist or none do, and other transactions see it as if it ran alone. A funds transfer that debits one account and credits another is the standard example: stopping half-way, or interleaving it carelessly with another transfer, leaves the database wrong.
The transaction model used by every later concurrency topic is the read and write operations, the ACID properties and the component of the system responsible for each, the transaction states, and the anomalies that uncontrolled interleaving causes. The same model is enough to tell which property or component is at fault in a scenario and which state transitions are possible.
Prerequisites
None within the GATE syllabus.
Core concepts
Operations. A transaction accesses data items (a row, a block, a field) through:
- , read: copy item from the database (via the buffer) into a local variable;
- , write: copy a local value back to item in the buffer, from where it reaches disk later;
- commit and abort.
Computation on local variables is invisible to the database; only reads and writes matter for correctness of interleavings.
The ACID properties and who enforces them:
| Property | Meaning | Ensured by |
|---|---|---|
| Atomicity | all operations of a transaction take effect, or none do | recovery system (undo using the log) |
| Consistency | a transaction run alone takes a consistent database to a consistent one | the programmer, helped by integrity constraints |
| Isolation | concurrent execution has the effect of some serial execution | concurrency-control system |
| Durability | effects of a committed transaction survive later failures | recovery system (redo using the log, stable storage) |
Storage model. Atomicity and durability are defined against three kinds of storage. Volatile storage (main memory, the buffer) loses its contents in a system crash. Nonvolatile storage (disk, flash) survives a crash but can fail. Stable storage is an abstraction that never loses data, approximated by keeping several copies on independent nonvolatile devices. The log that recovery relies on must reach stable storage before a transaction is declared committed; this is why a write executed by is not yet durable when it is only in the buffer.
Transaction states (the five states of Korth, Silberschatz and Sudarshan):

After an abort the system may restart the transaction (as a new transaction) if the failure was not caused by its own logic, or kill it. A committed transaction cannot be undone by aborting; its effects can only be reversed by a separate compensating transaction.
How it works: why concurrency needs control
Running transactions concurrently improves throughput (CPU and disk work overlap) and response time (short transactions need not wait behind long ones). Without control, interleaving produces these anomalies:
- Lost update: two transactions read the same value and both write; the first write is overwritten.
- Dirty read (temporary update): a transaction reads another transaction's still-uncommitted value, regardless of whether that writer later commits or aborts. A later abort makes the dependency especially harmful.
- Incorrect summary (inconsistent analysis): an aggregate reads some items before and some after another transaction's updates.
- Unrepeatable read: a transaction reads the same item twice and gets two different values because another transaction wrote it in between.
The rest of the concurrency notes define which interleavings are acceptable (Schedules and Serializability) and protocols that allow only those.
Mathematical explanation
A schedule is an interleaving of the operations of a set of transactions that keeps each transaction's own order. A serial schedule runs the transactions one after another; with transactions there are serial schedules. Isolation is formalised as serializability: the schedule must be equivalent to some serial schedule. Consistency of each transaction alone, plus serializability, gives a consistent final state, because a serial schedule is a sequence of consistency-preserving steps.
The number of all schedules grows quickly: transactions with operations have interleavings. Two transactions of 3 operations each already have schedules, of which only 2 are serial.
Worked examples
Example 1: atomicity. transfers 100 from to : , , , , , . If the system crashes after reaches disk but before , the database shows , : the total drops from 800 to 700. Atomicity requires the recovery system to undo .
Example 2: lost update. . : ; : . The interleaving ends with ; both serial orders give . The update of is lost. Of the 6 interleavings, the 2 serial ones give 110, the 2 in which writes last after both reads give 120, and the 2 in which writes last after both reads give 90 (the update of is lost).
Example 3: dirty read. . executes with value 90. executes (reads 90), with value 110, and commits. Then aborts. Undoing restores its before-image , which also erases the write of the committed ; not undoing it leaves 110, a value computed from a write that officially never happened. Either way a committed transaction is wrong, so the schedule must be prevented (Recoverability calls it nonrecoverable).
Example 4: incorrect summary. , . moves 10 from to while sums the two. With (reads 50) before runs and (reads 60) after, reports , but every consistent state has total 100.
Example 5: unrepeatable read. reads ; writes and commits; reads again and sees 90.
Example 6: which property? A system that keeps committed results only in volatile memory violates durability. Two correct transfers that interleave into a wrong total violate isolation. A transfer program that credits 100 but debits 10 violates consistency, and no DBMS component can repair it.
Example 7: counting schedules. has 2 operations and has 3: there are schedules, 2 of them serial. Three transactions of 2 operations each have schedules and serial ones.
Related material. SQL lets a transaction weaken isolation. The SQL standard defines four isolation levels by the phenomena they allow: READ UNCOMMITTED allows dirty reads, nonrepeatable reads and phantoms; READ COMMITTED prevents dirty reads; REPEATABLE READ also prevents nonrepeatable reads; SERIALIZABLE prevents all three. (Korth 17.8; Elmasri and Navathe 20.6.)
Important properties and observations
- Atomicity and durability are the recovery system's job; isolation is concurrency control's; consistency is the programmer's.
- Commit point: once committed, a transaction's effects are permanent; abort is impossible.
- Failed is not aborted: failed means normal execution cannot continue; aborted means rollback is complete.
- Concurrency is worth it for throughput and response time, but needs control.
- Anomalies arise only from conflicting accesses to the same item with at least one write.
Common misconceptions.
- "Consistency is guaranteed by the DBMS." It depends on the transaction being correct; the DBMS checks only declared constraints.
- "Partially committed means committed." The commit record may not be durable yet; a failure still leads to abort.
- "Concurrent execution always gives the same result as some serial order." Only if it is controlled; Example 2 gives a result no serial order gives.
GATE examination perspective
- Match property to component. Atomicity and durability to recovery, isolation to concurrency control.
- State diagram. Which transitions exist (for example, there is no transition from committed to aborted).
- Identify the anomaly. Given a short interleaving, identify the anomaly and compute the final values.
- Count schedules. Total interleavings and serial schedules.
Summary
Sources
- A. Silberschatz, H. F. Korth, S. Sudarshan, Database System Concepts, 7th ed., McGraw-Hill, 2019 (2020 copyright), 17.1 Transaction Concept, 17.2 A Simple Transaction Model, 17.3 Storage Structure, 17.4 Transaction Atomicity and Durability, 17.5 Transaction Isolation, 17.8 Transaction Isolation Levels.
- R. Elmasri, S. B. Navathe, Fundamentals of Database Systems, 7th ed., Pearson, 20.1 Introduction to Transaction Processing, 20.2 Transaction and System Concepts, 20.3 Desirable Properties of Transactions, 20.6 Transaction Support in SQL.