Professional Documents
Culture Documents
Chapter Outline
1 Introduction to Transaction Processing
2 Transaction and System Concepts
3 Desirable Properties of Transactions
4 Characterizing Schedules based on Recoverability
5 Characterizing Schedules based on Serializability
6 Transaction Support in SQL
Chapter 17-3
Concurrency
Interleaved processing: concurrent execution of
processes is interleaved in a single CPU
Parallel processing: processes are concurrently
executed in multiple CPUs.
Elmasri/Navathe, Fundamentals of Database Systems, Fourth Edition
Copyright 2004 Ramez Elmasri and Shamkant Navathe
Chapter 17-4
Chapter 17-5
Chapter 17-6
3.
Chapter 17-7
Chapter 17-8
FIGURE 17.2
Two sample transactions. (a) Transaction T1.
(b) Transaction T2.
Chapter 17-9
Chapter 17-10
Chapter 17-11
FIGURE 17.3
Some problems that occur when concurrent
execution is uncontrolled. (a) The lost update
problem.
Chapter 17-12
Chapter 17-13
Chapter 17-14
Chapter 17-15
Chapter 17-16
6.
Chapter 17-17
Chapter 17-18
Chapter 17-19
Chapter 17-20
Chapter 17-21
FIGURE 17.4
State transition diagram illustrating the states for
transaction execution.
Chapter 17-22
Chapter 17-23
Chapter 17-24
Chapter 17-25
Chapter 17-26
Chapter 17-27
Chapter 17-28
Chapter 17-29
Chapter 17-30
can be
Chapter 17-31
to be rolled back.
*A schedule S is recoverable if no transaction T in S commits
until all transactions T that have written an item that T reads
have committed.
Cascadeless schedule: One where every transaction reads
only the items that are written by committed transactions.
Schedules requiring cascaded rollback: A schedule in which
uncommitted transactions that read an item from a failed
transaction must be rolled back.
Elmasri/Navathe, Fundamentals of Database Systems, Fourth Edition
Copyright 2004 Ramez Elmasri and Shamkant Navathe
Chapter 17-32
Chapter 17-33
Chapter 17-34
Chapter 17-35
Chapter 17-36
Chapter 17-37
Chapter 17-38
Chapter 17-39
Chapter 17-40
Chapter 17-41
Chapter 17-42
Chapter 17-43
Chapter 17-44
FIGURE 17.7
Constructing the precedence graphs for schedules A and D from
Figure 17.5 to test for conflict serializability. (a) Precedence graph for
serial schedule A. (b) Precedence graph for serial schedule B. (c)
Precedence graph for schedule C (not serializable). (d) Precedence
graph for schedule D (serializable, equivalent to schedule A).
Chapter 17-45
FIGURE 17.8
Another example of serializability testing. (a) The
READ and WRITE operations of three transactions
T1, T2, and T3.
Chapter 17-46
Chapter 17-47
Chapter 17-48
Chapter 17-49
Chapter 17-50
Chapter 17-51
Chapter 17-52
Chapter 17-53
Chapter 17-54
Chapter 17-55
Chapter 17-56
___________________________________
Dirty
nonrepeatable
read
read
phantom
_____ _________ ____________________
yes
yes
yes
no
yes
yes
no
no
yes
no
no
no
Chapter 17-57