Pages 6389: Exercises 17.14
Discuss the final result of the different schedules in Figure 17.3(a) and (b), where M = 2 and N = 2,
with respect to the following questions. Does adding the above condition change the final outcome?
Does the outcome obey the implied consistency rule (that the capacity of X is 90)?
As long as the initial value isn’t X>88, the condition doesn’t change the outcome. The value of X isn’t
updated if the value is greater than 90 so as long as the value of x<90, it does obey the implied
consistency rule.
Pages 6389: Exercises 17.16
Add the operation commit at the end of each of the transactions T
1
and T
2
from Figure 17.2; then list
all possible schedules for the modified transactions. Determine which of the schedules are
recoverable, which are cascadeless, and which are strict.
T
1
T
2
read_item(X);
read_item(X);
X := X  N;
X := X + M;
write_item(X);
write_item(X);
read_item(Y);
commit T
2
Y := Y + N;
write_item(Y);
commit T
1
Shorthand notation:
T
1
: r
1
(X); w
1
(X); r
1
(Y); w
1
(Y); C
1
;
T
2
: r
2
(X); w
2
(X); C
2
;
In this case, m=2 (T
1
and T
2
) and n
1
= 5 and n
2
= 3.
The number of possible schedules is:
8!/(5!*3!) = 40320/720 = 56
Recoverable = after T is committed, never be necessary rolled back
NonRecoverable = after T is committed, rolled back
Cascadeless = every transaction is only read by committed transactions.
Strict = never read or written (x) until the last T(x) is committed.
The following listing is all 56 possible schedules and which are recoverable, which are cascadeless,
and which are strict.
S
1
: r
1
(X); w
1
(X); r
1
(Y); w
1
(Y); C
1
; r
2
(X); w
2
(X); C
2
; strict
S
2
: r
1
(X); w
1
(X); r
1
(Y); w
1
(Y); r
2
(X); C
1
; w
2
(X); C
2
; recoverable
S
3
: r
1
(X); w
1
(X); r
1
(Y); w
1
(Y); r
2
(X); w
2
(X); C
1
; C
2
; recoverable
S
4
: r
1
(X); w
1
(X); r
1
(Y); w
1
(Y); r
2
(X); w
2
(X); C
2
; C
1
; nonrecoverable
S
5
: r
1
(X); w
1
(X); r
1
(Y); r
2
(X); w
1
(Y); C
1
; w
2
(X); C
2
; recoverable
S
6
: r
1
(X); w
1
(X); r
1
(Y); r
2
(X); w
1
(Y); w
2
(X); C
1
; C
2
; recoverable
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
S
7
: r
1
(X); w
1
(X); r
1
(Y); r
2
(X); w
1
(Y); w
2
(X); C
2
; C
1
; nonrecoverable
S
8
: r
1
(X); w
1
(X); r
1
(Y); r
2
(X); w
2
(X); w
1
(Y); C
1
; C
2
; recoverable
S
9
: r
1
(X); w
1
(X); r
1
(Y); r
2
(X); w
2
(X); w
1
(Y); C
2
; C
1
; nonrecoverable
S
10
: r
1
(X); w
1
(X); r
1
(Y); r
2
(X); w
2
(X); C
2
; w
1
(Y); C
1
; nonrecoverable
S
11
: r
1
(X); w
1
(X); r
2
(X); r
1
(Y); w
1
(Y); C
1
; w
2
(X); C
2
; recoverable
S
12
: r
1
(X); w
1
(X); r
2
(X); r
1
(Y); w
1
(Y); w
2
(X); C
1
; C
2
; recoverable
S
13
: r
1
(X); w
1
(X); r
2
(X); r
1
(Y); w
1
(Y); w
2
(X); C
2
; C
1
; nonrecoverable
S
14
: r
1
(X); w
1
(X); r
2
(X); r
1
(Y); w
2
(X); w
1
(Y); C
1
; C
2
; recoverable
S
15
: r
1
(X); w
1
(X); r
2
(X); r
1
(Y); w
2
(X); w
1
(Y); C
2
; C
1
; nonrecoverable
S
16
: r
1
(X); w
1
(X); r
2
(X); r
1
(Y); w
2
(X); C
2
; w
1
(Y); C
1
; nonrecoverable
S
17
: r
1
(X); w
1
(X); r
2
(X); w
2
(X); r
1
(Y); w
1
(Y); C
1
; C
2
; recoverable
S
18
: r
1
(X); w
1
(X); r
2
(X); w
2
(X); r
1
(Y); w
1
(Y); C
2
; C
1
; nonrecoverable
S
19
: r
1
(X); w
1
(X); r
2
(X); w
2
(X); r
1
(Y); C
2
; w
1
(Y); C
1
; nonrecoverable
S
20
: r
1
(X); w
1
(X); r
2
(X); w
2
(X); C
2
; r
1
(Y); w
1
(Y); C
1
; nonrecoverable
S
21
: r
1
(X); r
2
(X); w
1
(X); r
1
(Y); w
1
(Y); C
1
; w
2
(X); C
2
; strict
S
22
: r
1
(X); r
2
(X); w
1
(X); r
1
(Y); w
1
(Y); w
2
(X); C
1
; C
2
; cascadeless
S
23
: r
1
(X); r
2
(X); w
1
(X); r
1
(Y); w
1
(Y); w
2
(X); C
2
; C
1
; cascadeless
S
24
: r
1
(X); r
2
(X); w
1
(X); r
1
(Y); w
2
(X); w
1
(Y); C
1
; C
2
; cascadeless
S
25
: r
1
(X); r
2
(X); w
1
(X); r
1
(Y); w
2
(X); w
1
(Y); C
2
; C
1
; cascadeless
S
26
: r
1
(X); r
2
(X); w
1
(X); r
1
(Y); w
2
(X); C
2
; w
This is the end of the preview.
Sign up
to
access the rest of the document.
 Fall '09
 Unknown
 Twophase locking

Click to edit the document details