50 likes | 215 Views
CS 775/875: Fall 2000. Chapter 12: Transactions and Concurrency Control. Transactions. What is a transaction? ACID properties: Atomicity, Consistency, Isolation, Durability Serializable transactions Open, close, commit/abort
E N D
CS 775/875: Fall 2000 Chapter 12: Transactions and Concurrency Control
Transactions • What is a transaction? • ACID properties: Atomicity, Consistency, Isolation, Durability • Serializable transactions • Open, close, commit/abort • Concurrency control---The lost update problem, inconsistent retrieval, serial equivalence • Conflicting Operations • Dirty reads, premature writes, cascaded aborts, tentative versions • Nested Transactions • Locks; implementation; nested transactions • Deadlocks
Optimistic Concurrency Control • Locks present an overhead, may cause deadlocks, reduces concurrency • Optimistic---assumes that data conflicts are rare • Kung and Robinson algorithm: Working phase, validation phase, update phase • Tentative versions, reads on committed versions only, writes on tentative versions • Validation of transactions: Backward validation and forward validation; transaction numbers assigned at the beginning of validation phase; • Only one transaction can be in the validation phase; until this is completed, no new validation begins
Optimistic Concurrency Control • See Fig. 12.28 http://www.cdk3.net/ig/slides/Chapter12Slides.pdf • Backward validation: Compare readset with the already committed transactions • Forward validation: Compare writeset with the readsets of all overlapping active transactions • Starvation is a problem with optimistic CC
Timestamp Ordering • Basic TO rule: “A transaction’s request to write an object is valid only if that object was last read and written by earlier transactions. A transaction’s request to read an object is valid only if that object was last written by an earlier transaction. • Transactions are only committed in the order of their numbers. • See Fig. 12.30 and 12.31 • http://www.cdk3.net/ig/slides/Chapter12Slides.pdf • Multiversion TS ordering