Transaction Atomicity
publish date: 2026/06/11 07:37:11.141023 UTC
A user makes an online flight booking. The system deducts the seat from the available inventory, charges the credit card, and sends a confirmation email. Halfway through, the network fails after the seat is reserved but before the payment is processed. What is the correct behaviour of a transaction processing system in this scenario?
Correct Answer
Explanation
A database transaction is treated as a single atomic unit. All of the operations in a transaction must be completed before the database changes are made permanent. This ensures that failure of operations within the transaction does not lead to inconsistencies in the database. If the network fails mid-transaction, the seat reservation is not committed and the database remains unchanged - ensuring consistency.
Reference
Software Engineering, Ian Sommerville, 10th edition
