in Databases
7,991 views
2 votes
2 votes

Consider the given schedule and choose the suitable option S = T1:R(x), T1:R(y), T1:W(x), T2:R(y), T3:W(y), T1:W(x), T2:R(y)

  1. Schedule is view serializable
  2. Schedule is conflict serializable but not view serializable
  3. Schedule is view serializable but not conflict serializable
  4. Neither view serializable nor conflict serializable
in Databases
by
8.0k views

1 Answer

1 vote
1 vote
Best answer
T1 T2 T3
R(x)    
R(y)    
W(x)    
  R(y)  
    W(y)
W(x)    
  R(y)  

Here $T1$ is only doing operations on Data item $x$ so we can ignore the $R(x)$ and $W(x)$ as they will not produce any conflicts.

T1 T2 T3
     
R(y)    
     
  R(y)  
    W(y)
     
  R(y)  

Since there is a cycle $T2\rightarrow T3\rightarrow T2$ produced due to $R(y)W(y)$ and $W(y)R(y)$ conflicts

$\Rightarrow$ The schedule is $not$ conflict serializable.

For view serializable,

Since the graph contains a blind write at $T3$ so view serializable schedule is not equal to conflict serializable schedule.

$T1:R(y)$ and $T2:R(y)$ are initial reads and $T2:R(y)$ is at last and also we have only 1 Write operation by T3:W(y) so we can't make a serial schedule by executing in the any order.

So the sequence is not view serializable.

$\therefore$ Option $D.$ is the correct answer.

edited by

4 Comments

One of the condition for checking view serializability is-

'If a transaction T1 updated A at last in S1, then in S2 also T1 should perform final write operations'

And not-

'2. The Transaction which does  final R/W on data x in S1 = Transaction which does final R/W on data x in S2.'

You have written that either final read or final write which is wrong. It should have been only final write.
0
0
exactly, the conditions for view equivalent schedules are

1) Initial read should be the same

2) Final write should be the same

3) WR conflicts should be in the same order

IMO the answer is wrong and the schedule shouldn't be view serializable as the final write is done by T3 and it but there is a read before and after T3 by T2, so no serial schedule can do the same.
0
0
edited by

@sfarhat @wittyoak

Yes you are right.

Thankyou for correcting me.

Initial read means directly reading from database, which are done by both T1 and T2 , hence it is not view serializable.

1
1