Question: Repeat Exercise 20.14, adding a check in T 1 so that Y does not exceed 90. Exercise 20.14 Change transaction T 2 in Figure 20.2(b)
Repeat Exercise 20.14, adding a check in T1 so that Y does not exceed 90.
Exercise 20.14
Change transaction T2 in Figure 20.2(b) to read
read_item(X);
X := X + M;
if X > 90 then exit
else write_item(X);
Discuss the final result of the different schedules in Figures 20.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)?
Figures 20.3(a) and (b):

Figure 20.2(b)

Figure 20.3 Some problems that occur when concurrent execution is uncontrolled. (a) The lost update problem. (b) The temporary update problem. (c) The incorrect summary problem. (a) read_item(X); X=X- N; read item(X); X= X+ M; write_item(X); read_item(Y); Time Item X has an incorect value because write_item(X); its update by T, is lost (overwnitten). Y =Y+ N; write_item(Y); (b) read_item(X); X=X- N; write_item(X); read_item(X); X=X+ M; write_item(X); Time Transaction T, faila and must change the value of X back to its old value; meanwhile T, has read the temporary incorrect value of X. read item(Y);
Step by Step Solution
3.42 Rating (158 Votes )
There are 3 Steps involved in it
To answer your question we need to add a check to transaction T from Figure 203 to ensure that the value of Y does not exceed 90 In the original Exercise 2014 there is a check added to transaction T i... View full answer
Get step-by-step solutions from verified subject matter experts
