A retail company uses a point-of-sale (POS) system that records each sales transaction in a database. Each transaction involves reading the current inventory, updating the stock level, and recording the sale. The database must ensure that concurrent transactions do not interfere with each other, so that one transaction does not see partially updated data from another. Which property of a database transaction ensures this isolation?
Isolation is the ACID property that separates the effects of concurrent transactions so that one transaction cannot see the intermediate, uncommitted state of another. Without isolation, a POS system could read inventory levels that another sale is in the middle of updating, leading to overselling or duplicate charges. Isolation ensures that the concurrent execution produces the same result as some serial order of the transactions, thereby preventing dirty reads, non-repeatable reads, and phantom reads. This directly addresses the retail scenario described.
Why this answer
Isolation ensures that concurrent transactions do not interfere with each other, so each transaction sees a consistent snapshot of the database as if it were the only transaction running. In the POS scenario, isolation prevents one transaction from reading partially updated inventory data from another transaction, which could lead to overselling or stock discrepancies. This property is typically implemented through locking mechanisms or multi-version concurrency control (MVCC).
Exam trap
The trap here is that candidates often confuse isolation with atomicity, thinking that 'not seeing partially updated data' is about the transaction being all-or-nothing, when in fact it is about preventing interference between concurrent transactions.
How to eliminate wrong answers
Option A is wrong because atomicity ensures that a transaction is treated as a single, indivisible unit that either fully completes or fully rolls back, but it does not control how concurrent transactions interact. Option B is wrong because consistency ensures that a transaction brings the database from one valid state to another, preserving integrity constraints, but it does not manage concurrent access. Option D is wrong because durability guarantees that once a transaction is committed, its changes persist even in the event of a system failure, but it has no role in isolating concurrent transactions.