Q5.
1.
A precedence for transactions of schedule can be drawn by including the Transactions T1,T2,T3 as nodes of the graph and drawing a directed edge from one transaction to other i.e. Ti ->Tj, if an operation on an object is performed in transaction Ti before a conflicting operation on same object in transaction Tj.
In the given schedule S Transaction T1 performs write operation on B before Transaction T2 performs write operation on B (write-write conflict), so there will be a directed edge from T1 to T2, (T1->T2).
Transaction T2 performs write operation on A before Transaction T3 performs conflicting write operation on A (write-write conflict), so there will be a directed edge from T2 to T3,( T2->T3).
Resultant precedence graph:
2.
For finding weather a Schedule is conflict serializable or not, its precedence graph is drawn , if there is cycle present in the precedence graph then the schedule is not conflict serializable.
From the precedence graph in part 1, there is no cycle present in it, so the schedule S is conflict serializable.
3.
Yes, it is possible to construct serial schedule S' that is conflict equivalent to S.
First all the operations of T1 should be performed, then all the operations of T2 should be performed, at the end all the operations of T3 should be performed.
T1 | T2 | T3 |
read(B) write(B) |
read(A) write(A) read(B) write(B) |
read(A) write(A) |
4.
A recoverable schedule is one in which if a transaction reads value written by other transaction the it should commit only after the other transaction has committed.
In the given schedule in part 4 the transaction T3 reads value of A which is written by T2 and T2 is not committed, and T3 commits before T2, so it is not recoverable schedule.
Q5: In DBMS, a graph precedence is used to test whether a schedule of concurrent transactions...
Q5: In DBMS, a graph precedence is used to test whether a schedule of concurrent transactions is conflict serializable or not. Given the following schedule S with three transactions T T3 T2 read(A) read(B) write(A) read(A) write(B) write(A) read(B) write(B) 1. Draw the precedence graph for the schedule S (5 points) 2. Check whether the schedule S conflict serializable or not (5 points] 3. Is it possible to construct a serial schedule S'which is conflict equivalent to the schedule S?...
1. Consider the following schedule S TI T2 read(A) write(A write(A) write(A (a) Draw the precedence graph of S (b) Is schedule S serializable? If so, name one equivalent serial schedule, and prove equivalence (c) Denote by S"the schedule obtained by replacing the write(A) in T2 with read(A) in S. Is schedule S" serializable? If so, name one equivalent serial schedule and prove equivalence. Otherwise prove that it is not. (d) Denote by S"the schedule obtained by replacing the write(A)...
-Advanced Database- Consider the following transaction schedule, where time increases from top to bottom. T1 T2 T3 T4 Read (X) Read(Y) Read(Z) Read(Y) Write(Y) Write(Z) Read(U) Read(Y) Write(Y) Read(Z) Write(Z) Read(U) Write(U) Answer the following questions: Draw the precedence graph of the above schedule. Is this schedule conflict serializable? If yes, show what serial schedule(s) it is equivalent to. If not, explain why. Is this schedule view serializable? If yes, show what serial schedule(s) it is equivalent to. If not,...
For each of the following schedules, draw the precedence graph and argue if the schedule is con ict serializable. If the schedule is con ict serializable, give one possible equivalent serial schedule. (Ri means transaction i reads an item and Wi writes an item.) a) R1(A);W1(A);R2(A);R2(B);W3(B);W2(C);R4(A);R4(B);R4(C);R2(D);R3(E);W1(E); b) R1(A);R4(A);W1(A);W3(B);R2(A);R2(B);R4(B);R4(C);R2(D);R3(E)
2. Given the following three transactions T1 = r1(x); w1(y); T2 = r2(z); r2(y); w2(y); w2(x); T3 = r3(z); w3(x); r3(y); Consider the schedule S = r1(x); r3(z); r2(z); w3(x); r2(y); r3(y); w2(y); w1(y); w2(x); a. Draw the precedence graph of schedule S, and label each edge with data item(s). b. Based on the precedence graph, determine whether S is conflict serializable and justify your answer. If it is serializable, specify all possible equivalent serial schedule(s).
2. Consider the following two transactions: (10 points) T13: read(A); read(B); if A = 1 then B := B - 1; write(B). T14: read(B); read(A); if B = 1 then A := A - 1; write(A). Let the consistency requirement be A = 1 or B = 1, with A = 1 and B = 1 as the initial values. a. Show that every serial execution involving these two transactions preserves the consistency of the database. b. Show a concurrent...
1. What is the difference between Two-Phase Locking (2PL) and Strict Two-Phase Locking? What condition to Strict 2PL prevent that 2PL does not prevent? 2. What are deadlocks? What are two techniques for detecting and resolving deadlocks? 3. In the figure below, R(X, y) means read database item X into variable y and W(X, y) means write variable y into database item y. Column T1 shows transaction T1's operations and column T2 shows T2's operations. Columns Aand_B show the values...
This comes from a class on databases (c) Transaction Processing Consider the following schedule: transaction TI Transaction T2 read(X) write(X) read(Y) write(Y) read write (Y) read (X) write read(W) write(W) read(Z) write(z) i. Is the schedule (conflict) serializable? If yes, give an equivalent serial schedule; if not, explain why not. ii. Add read-lock0, write-lock and unlock instructions to the schedule following the two-phase locking protocol. Is there deadlock present?
Consider the following schedule that performs actions taken by transactions T1 and T2 on database objects A and B : T1: S(A), R(A), X(B), U(A), R(B),W(B), Commit: U(B) T2: S(B), R(B), X(A), U(B), R(A), W(A), Commit: U(A) Because Strict 2PL is using, this schedule is guaranteed to be conflict serializable. A: True B:False
Consider the following schedule that performs actions taken by transactions 71 and T2 on database objects A and B: T1: R(A), WA), RIC), W(B), Commit R(B), W(B), Commit The above schedule results in an) T2: OA cascading aborts OB write-read conflict write-write conflict OD read-write Conflict