Chapter20(4)
Chapter20(4)
Introduction to Transaction
Processing Concepts and Theory
Parallel processing
Figure 20.3 (cont’d.) Some problems that occur when concurrent execution is
uncontrolled (b) The temporary update problem
Copyright © 2016 Ramez Elmasri and Shamkant B. Navathe Slide 20-13
The Incorrect Summary Problem
• If one transaction is calculating an aggregate sum function on a
number of records while other transactions are updating some of
these records, the aggregate function may calculate some values
before they are updated and others after they are updated.
Suppose T3 is calculating the total number of
reservations on all the flights while T1 is executing. The
result of T3 will be off by an amount N because T3 reads the
value of X after N seats have been subtracted from it, but
reads the value of Y before those N seats have been added
to it.
Figure 20.3 (cont’d.) Some problems that occur when concurrent execution is uncontrolled (c)
The incorrect summary problem
Copyright © 2016 Ramez Elmasri and Shamkant B. Navathe Slide 20-14
The Unrepeatable Read Problem
Transaction T reads the same item twice
Value is changed by another transaction T between the
two reads
Hence, T receives different values for the two reads of the
same item
Ex: During an airline reservation transaction, a customer
inquires about seat availability on several flights. When the
customer decides on a particular flight, the transaction then
reads the number of seats on that flight again, and it may
end up reading a different value.
Two operations in a schedule are said to conflict if they
satisfy ALL three of the following conditions:
1. They belong to different transactions;
2. They access the same item X;
3. At least one of the operations is a write_item(X).
Figure 20.6 Two schedules that are result equivalent for the initial value
of X = 100 but are not result equivalent in general
Figure 20.7 Constructing the precedence graphs for schedules A to D from Figure 20.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)
Copyright © 2016 Ramez Elmasri and Shamkant B. Navathe
Testing for
Conflict
Serializability
– Example2
20.8