The Five States of Transactions: Active: Partially Committed
The Five States of Transactions: Active: Partially Committed
Consider a bank transfer transaction that involves transferring money from one account to
another.
Active: The transaction starts when a user initiates the transfer, specifying the source and
destination accounts, and the amount to be transferred.
Partially Committed: The system updates the source account by deducting the transfer amount.
At this stage, the transaction is partially committed. If an error occurs or a conflict arises, the
system can roll back the changes to the source account.
Committed: The system updates the destination account by adding the transferred amount. If
both updates are successful, the transaction is committed, and the money has been transferred
successfully.
Aborted: If an error occurs during the transaction, such as insufficient funds in the source
account or a system failure, the transaction will be aborted. The system will undo the changes
made to the source account, ensuring that the original balance is restored.
Failed: If the transaction encounters a critical error that cannot be recovered, it is considered
failed. In this case, the system may attempt to restart the transaction or notify the user of the
failure.
References:
Silberschatz, A., Korth, H.F., & Sudarshan, S. (2001). Database System Concepts (4th
ed.). New York, NY: McGraw-Hill.