Notes10 - Sections to Skim CS 245 Database System...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
CS 245 Notes 10 1 CS 245: Database System Principles Notes 10: More TP Steven Whang CS 245 Notes 10 2 Sections to Skim: • Section 18.8 [18.8] • Sections 19.2 19.4, 19.5, 19.6 [none, i.e., read all Ch 19] • [In the Second Edition, skip all of Chapter 20, and Sections 21.5, 21.6, 21.7, 22.2 through 22.7] CS 245 Notes 10 3 Chapter 19 [19] More on transaction processing Topics: • Cascading rollback, recoverable schedule • Deadlocks – Prevention – Detection • Long transactions (nested, compensation) CS 245 Notes 10 4 Example: T j T i W j (A) r i (A) Commit Ti Abort T j …… Non-Persistent Commit (Bad!) CS 245 Notes 10 5 Example: T j T i W j (A) r i (A) Commit Ti Abort T j Non-Persistent Commit (Bad!) avoided by recoverable schedules CS 245 Notes 10 6 Example: T j T i W j (A) r i (A) w i (B) Abort T j [Commit Ti] Cascading rollback (Bad!)
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
CS 245 Notes 10 7 Example: T j T i W j (A) r i (A) w i (B) Abort T j [Commit Ti] …… Cascading rollback (Bad!) avoided by avoids-cascading- rollback (ACR) schedules CS 245 Notes 10 8 • Schedule is conflict serializable • T j T i • But not recoverable CS 245 Notes 10 9 • Need to make “final’ decision for each transaction: commit decision - system guarantees transaction will or has completed, no matter what abort decision - system guarantees transaction will or has been rolled back (has no effect) CS 245 Notes 10 10 To model this, two new actions: • C i - transaction T i commits • A i - transaction T i aborts CS 245 Notes 10 11 ... Back to example: T j T i W j (A) r i (A) C i can we commit here? CS 245 Notes 10 12 Definition T i reads from T j in S (T j S T i ) if (1) w j (A) < S r i (A) (2) a j < S r i (A) (< : does not precede ) (3) If w j (A) < S w k (A) < S r i (A) then a k < S r i (A)
Background image of page 2
CS 245 Notes 10 13 Definition Schedule S is recoverable if whenever T j S T i and j i and C i S then C j < S C i CS 245 Notes 10 14 Note: in transactions, reads and writes precede commit or abort If C i T i , then r i (A) < C i w i (A) < C i If A i T i , then r i (A) < A i w i (A) < A i • Also, one of Ci, Ai per transaction CS 245 Notes 10 15 How to achieve recoverable schedules? CS 245
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

This document was uploaded on 03/08/2011.

Page1 / 11

Notes10 - Sections to Skim CS 245 Database System...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online