recategorized
3,831 views
1 votes
1 votes

Consider following schedules involving two transactions:

$S_{1}: \: r_{1}(X);r_{1}(Y);r_{2}(X);r_{2}(Y);w_{2}(Y);w_{1}(X)$

$S_{2}: \: r_{1}(X);r_{2}(X);r_{2}(Y);w_{2}(Y);r_{1}(Y);w_{1}(X)$

Which of the following statement is true?

  1. Both $S_1$ and $S_2$ are conflict serializable.
  2. $S_1$ is conflict serializable and $S_2$ is not conflict serializable
  3. $S_1$ is not conflict serializable and $S_2$ is conflict serializable
  4. Both $S_1$  and $S_2$ are not conflict serializable
recategorized

7 Answers

2 votes
2 votes

Ans will be C

conflict serializable means we can first run one Transactioon then after it second without any conflict 

conflict occurs when data item is same and at least one operation is read

so for S1    r1(X); r1(Y); r2(X); r2(Y); w2(Y); w1(X)   

here w1(x) can not be placed before r2(X)  as data item is common(X) and one operation is write so it is not conflict serializable

now for S2   r1(X); r2(X); r2(Y); w2(Y); r1(Y); w1(X)

here r1(X) can be placed after w2(Y) as data item is different and before that only read operation are there so it is conflict serializable as T2 can be executed before T1

1 votes
1 votes

S1 is not confllct serializable and S2 is conflict serializable 

option 3

There is a slightly mistake in S2: Direction is from 2 --> 1 not 1 --> 2

edited by
0 votes
0 votes

S1: here we can see that two confilcting operations r1(y)->w2(y)  and r2(x)->w1(x),so there will be edge from T1 to T2 and T2 to T1 ..so there will be a loop in the graph!So it is not conflict serializable

S2:But here we are not getting such loops in graph for any edge..So it is conflict serialisable

C is correct answer Here

0 votes
0 votes

Option C

s1: t1->t2 & t2-> t1 cycle exits

s2t2-> t1 no cycle exits

if cycle -> not conflict serializable

Answer:

Related questions

1 votes
1 votes
3 answers
4
go_editor asked Jan 31, 2017
8,526 views
If following sequence of keys are inserted in a B+ tree with K(=3) pointers:8, 5, 1, 7, 3, 12, 9, 6Which of the following shall be correct B+ tree?