1. Transaction in DBMS A transaction is a logical unit of work. It includes read/write operations.
It
moves DB from one consistent state to another. It must complete fully or not at all. Example: bank
transfer. Failure leads to rollback. Ensures integrity.
2. ACID Properties Atomicity: all or nothing. Consistency: valid state. Isolation: no interference.
Durability: permanent storage. Ensures reliable DB system.
3. COMMIT vs ROLLBACK Commit saves changes permanently. Rollback undoes changes.
Commit after success, rollback after error. Controls transaction end.
4. SAVEPOINT Checkpoint inside transaction. Allows partial rollback. Example: rollback to
savepoint. Provides flexibility.
5. Transaction States Active, Partially committed, Committed, Failed, Aborted, Terminated.
6. Active & Committed Active: running. Committed: saved permanently. No rollback after commit.
7. Concurrency Control Manages multiple transactions. Prevents conflicts. Maintains consistency.
8. Dirty Read Reading uncommitted data. Causes inconsistency. Avoid using isolation.
9. Lost Update Two transactions update same data. One overwrites other. Solved by locking.
10. Importance Maintains consistency. Prevents errors. Improves efficiency.
11. Serial vs Non-Serial Serial: one by one. Safe but slow. Non-serial: concurrent, faster but risky.
12. Conflict Serializability Behaves like serial schedule. Uses precedence graph.
13. View Serializability Same result as serial. Hard to check.
14. Locks Shared: read only. Exclusive: read/write. Prevent conflicts.
15. Lock Protocol Use locks before access. Ensures consistency.
16. 2PL Growing: acquire locks. Shrinking: release locks. Ensures serializability.
17. Deadlock Transactions wait for each other. No progress.
18. Starvation Transaction waits indefinitely. Resource not given.
19. Recoverable Schedule Commit after dependent transaction. Ensures safe recovery.