Transactions - concurrency control Notes | EduRev

: Transactions - concurrency control Notes | EduRev

 Page 1


Introduction to Database Systems 
CSE 444 
Lecture 13  
Transactions: concurrency control  
(part 1) 
Magda Balazinska - CSE 444, Fall 2010 1 
Page 2


Introduction to Database Systems 
CSE 444 
Lecture 13  
Transactions: concurrency control  
(part 1) 
Magda Balazinska - CSE 444, Fall 2010 1 
Outline 
•? Serial and Serializable Schedules (18.1) 
•? Conflict Serializability (18.2) 
•? Locks (18.3) 
Magda Balazinska - CSE 444, Fall 2010 2 
Page 3


Introduction to Database Systems 
CSE 444 
Lecture 13  
Transactions: concurrency control  
(part 1) 
Magda Balazinska - CSE 444, Fall 2010 1 
Outline 
•? Serial and Serializable Schedules (18.1) 
•? Conflict Serializability (18.2) 
•? Locks (18.3) 
Magda Balazinska - CSE 444, Fall 2010 2 
The Problem 
•? Multiple transactions are running concurrently 
T
1
, T
2
, … 
•? They read/write some common elements 
A
1
, A
2
, … 
•? How can we prevent unwanted interference ? 
•? The SCHEDULER is responsible for that 
Magda Balazinska - CSE 444, Fall 2010 3 
Page 4


Introduction to Database Systems 
CSE 444 
Lecture 13  
Transactions: concurrency control  
(part 1) 
Magda Balazinska - CSE 444, Fall 2010 1 
Outline 
•? Serial and Serializable Schedules (18.1) 
•? Conflict Serializability (18.2) 
•? Locks (18.3) 
Magda Balazinska - CSE 444, Fall 2010 2 
The Problem 
•? Multiple transactions are running concurrently 
T
1
, T
2
, … 
•? They read/write some common elements 
A
1
, A
2
, … 
•? How can we prevent unwanted interference ? 
•? The SCHEDULER is responsible for that 
Magda Balazinska - CSE 444, Fall 2010 3 
Some Famous Anomalies 
•? What could go wrong if we didn’t have 
concurrency control: 
–? Dirty reads (including inconsistent reads) 
–? Unrepeatable reads 
–? Lost updates 
Many other things can go wrong too 
Magda Balazinska - CSE 444, Fall 2010 4 
Page 5


Introduction to Database Systems 
CSE 444 
Lecture 13  
Transactions: concurrency control  
(part 1) 
Magda Balazinska - CSE 444, Fall 2010 1 
Outline 
•? Serial and Serializable Schedules (18.1) 
•? Conflict Serializability (18.2) 
•? Locks (18.3) 
Magda Balazinska - CSE 444, Fall 2010 2 
The Problem 
•? Multiple transactions are running concurrently 
T
1
, T
2
, … 
•? They read/write some common elements 
A
1
, A
2
, … 
•? How can we prevent unwanted interference ? 
•? The SCHEDULER is responsible for that 
Magda Balazinska - CSE 444, Fall 2010 3 
Some Famous Anomalies 
•? What could go wrong if we didn’t have 
concurrency control: 
–? Dirty reads (including inconsistent reads) 
–? Unrepeatable reads 
–? Lost updates 
Many other things can go wrong too 
Magda Balazinska - CSE 444, Fall 2010 4 
Dirty Reads 
T
1
:  WRITE(A)  
T
1
:  ABORT 
T
2
:  READ(A) 
Magda Balazinska - CSE 444, Fall 2010 
Write-Read Conflict 
5 
Read More
Offer running on EduRev: Apply code STAYHOME200 to get INR 200 off on our premium plan EduRev Infinity!