Advanced DB Systems - CH 3
Advanced DB Systems - CH 3
Chapter Three
Introduction to Transaction
Processing Concepts and Theory
Chapter Outline
1
Advanced DB
2
Advanced DB
3
Advanced DB
4
Advanced DB
5
Advanced DB
6
Advanced DB
7
Advanced DB
8
Advanced DB
Transaction states:
• Active state
• Partially committed state
• Committed state
• Failed state
• Terminated State
9
Advanced DB
10
Advanced DB
11
Advanced DB
12
Advanced DB
13
Advanced DB
ACID properties:
Atomicity: A transaction is an atomic unit of
processing; it is either performed in its entirety or not
performed at all.
14
Advanced DB
15
Advanced DB
16
Advanced DB
17
Advanced DB
Practical approach:
Come up with methods (protocols) to ensure
serializability.
It’s not possible to determine when a schedule begins
and when it ends. Hence, we reduce the problem of
checking the whole schedule to checking only a
committed project of the schedule (i.e. operations from
only the committed transactions.)
Current approach used in most DBMSs:
– Use of locks with two phase locking
18
Advanced DB
19
Advanced DB
20
Advanced DB
21
Advanced DB
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).
FIGURE 17.8
Another example of serializability testing. (a) The
READ and WRITE operations of three transactions
T1, T2, and T3.
22
Advanced DB
23
Advanced DB
24
Advanced DB
25
Advanced DB
26
Advanced DB
27
Advanced DB
Type of Violation
___________________________________
Isolation Dirty nonrepeatable
level read read phantom
_____________________ _____ _________ ____________________
READ UNCOMMITTED yes yes yes
READ COMMITTED no yes yes
REPEATABLE READ no no yes
SERIALIZABLE no no no
28