14 b 2023 Adbms Solve
14 b 2023 Adbms Solve
A transaction is a single unit of work that may include multiple operations on a database, such
as reading, writing, and updating records. Transactions are used to ensure data integrity and
consistency, as they follow the ACID properties: Atomicity, Consistency, Isolation, and
Durability. In other words, a transaction must be fully completed or fully rolled back, leaving the
database in a stable state.
Example:
● Suppose there are two transactions, T1 and T2. A serial schedule would execute all
steps of T1 (like read, write, etc.) first, and then all steps of T2.
1. Active: The transaction is in progress and operations like read, write are happening.
2. Partially Committed: All operations have been executed, but the transaction is not yet
finalized.
3. Committed: The transaction has been completed successfully and changes are saved
permanently.
4. Failed: If an error occurs, the transaction enters this state and all changes must be
undone.
5. Aborted: The transaction has failed, and all its changes are rolled back to ensure
consistency.
3. (b) Explain ACID properties of transactions.
The ACID properties ensure reliability and integrity of database transactions. They are:
● Atomicity: The transaction must be completed as a whole; if any part fails, the entire
transaction is rolled back.
● Consistency: The database must remain in a consistent state before and after the
transaction.
● Isolation: Transactions should not interfere with each other; they must appear as if
executed in isolation.
● Durability: Once a transaction is committed, the changes are permanent, even in the
event of a system failure.
Example:
● Suppose we have two schedules, S1 and S2. If both schedules have T1 reading a value
before T2 writes to it and produce the same final values, they may be view-equivalent.