https://moodle.cs.ubbcluj.ro/pluginfile.php/50138/mod_resource/content/1/DBMSs_Lecture4.pdf
https://moodle.cs.ubbcluj.ro/pluginfile.php/50141/mod_resource/content/1/DBMSs_Lecture5.pdf
Recovery Manager
-
ensures:
- atomicity - effects of uncommitted transactions are undone
- durability - effects of committed transactions survive system crashes

- the system comes back up:
- the effects of T1 & T2 must persist
- T3 & T4 are undone (their effects are not persisted in the DB)
Transaction Failure
Causes
- system failure (hardware failures, bugs in the operating system, database system, etc.)
- all running transactions terminate
- contents of internal memory - affected (i.e. lost)
- contents of external memory - not affected
- application error (“bug”, e.g. division by 0, infinite loop, etc.) ⇒ transaction fails; it should be executed again only after the error is corrected
- action by the Transaction Manager (TM)
- e.g. deadlock resolution scheme
- a transaction is chosen as the deadlock victim and terminated
- the transaction might complete successfully if executed again
- self-abort
- based on some computations, a transaction can decide to terminate and undo its actions
- there are special statements for this purpose, e.g. ABORT, ROLLBACK
- can be seen as a special case of action by the TM
Normal Execution
- during normal execution, transactions read / write database objects
- reading database object O:
- bring O from disk into a frame in the Buffer Pool (BP)
- copy O’s value into a program variable
- writing database object O:
- modify an in-memory copy of O in the Buffer Pool (BP)
- write the in-memory copy to disk
Buffer Manager

Writing Objects
Transaction T changes object O (in frame F in the BP)