DBMS Topics
Transaction Management
Last Updated : 21 May, 2026
A transaction is a logical unit of work consisting of one or more database operations reads/writes that must be executed as a single indivisible unit. Either ALL operatio
What is a Transaction?
A transaction is a logical unit of work consisting of one or more database operations (reads/writes) that must be executed as a single indivisible unit. Either ALL operations complete successfully, or NONE of them are applied to the database.
Why Transactions are Needed
Without transactions, two problems arise:
Problem 1 — Concurrent Access Anomalies
Problem 2 — System Failure Mid-Operation
| T: Transfer A | B ₹5000 |
| Step 1 | A = A − 5000 (written to disk) |
| Step 2 | B = B + 5000 (never executed) |
Transactions with ACID properties solve both problems.
ACID Properties (Overview)
| Property | Meaning |
|---|---|
| Atomicity | All-or-nothing execution |
| Consistency | DB goes from valid state to valid state |
| Isolation | Transactions don't interfere with each other |
| Durability | Committed changes survive failures |
(Detailed in the ACID Properties topic)
Transaction Operations
| Operation | Notation | Description |
|---|---|---|
| Read | read(X) | Read data item X from DB into memory |
| Write | write(X) | Write data item X from memory to DB buffer |
| Commit | commit | Transaction completed successfully; changes permanent |
| Abort/Rollback | abort | Transaction failed; all changes undone |
Simple vs. Complex Transactions
Simple (single SQL statement)
UPDATE Accounts SET balance = balance − 1000 WHERE id = 'A';
← This is one transaction in autocommit mode
Complex (multiple statements)
BEGIN TRANSACTION;
UPDATE Accounts SET balance = balance − 1000 WHERE id = 'A';
UPDATE Accounts SET balance = balance + 1000 WHERE id = 'B';
INSERT INTO TransactionLog VALUES (...);
COMMIT;
← All three statements as one atomic unit
Concurrent Transactions — Problems Without Control
1. Lost Update Problem
2. Dirty Read (Temporary Update Problem)
3. Incorrect Summary Problem
Transaction Manager Role in DBMS
| Transaction Manager | ||
|---|---|---|
| - Ensures ACID properties | ||
| - Coordinates with: | ||
| • Concurrency Control Manager | ||
| • Recovery Manager | ||
| • Buffer Manager |
The Transaction Manager is responsible for:
- Beginning and ending transactions
- Coordinating concurrency control (locking/timestamps)
- Coordinating recovery (logging)
- Ensuring durability via write-ahead logging
Exam Focus
Revise definitions, diagrams, examples, and short-answer points for Transaction Management.
Interview Use
Prepare one clear explanation, one practical example, and one common mistake for this DBMS topic.
Search Terms
dbms, database management system, database notes, sql, unit, transaction, management, transaction management
Related DBMS Topics