Pages

Monday 5 December 2022

Conflict Serializability

Find out conflict serializability for the given transactions

T1

T2

T3

R(X)

 

 

 

 

R(Y)

 

 

R(X) 

t1 <- t3

 

R(Y)

t3 <- t2

 

 

R(Z)

t1 <- t2

 

 

 

W(Y)

 

W(Z)
t1 <- t2
and 
t1 <- t2

 

R(Z)

 

 

W(X)

 

 

W(Z)

 

 

 

 

 


Step 1: 
Conditions for read(R) and write(W)
R-W
W-R
W-W ->W-R
        ->W-W

Step 2:
Check out the conflict pairs in other transactions and then draw edges using Precedence Graph.

Precedence Graph:
Therefore the indegree of T1=2
Therefore the indegree of T2=0
Therefore the indegree of T3=1

Step 3:
Remove the indegree of T2 whose degree is 0 then the Precedence graph
Therefore the transaction to the given set is 
T2 --- T3 --- T1

Since there is no loop or cycle so it is conflict serializable which is serializable consistent.
T1 --- T2 --- T3
T1 --- T3 --- T2
T2 --- T1 --- T3
T2 --- T3 --- T1
T3 --- T1 --- T2
T3 --- T2 --- T1

Question:
check out whether the given schedule is conflict serializable or not  

T1

T2

T3

R(A)

t2<-t1

t3<-t1

 

 

 

W(A)

t1<-t2

 

W(A)

t3<-t1

 

 

 

 

W(A)

Step 1: 
Conditions for read(R) and write(W)
R-W
W-R
W-W ->W-R
        ->W-W

Step 2:
Check out the conflict pairs in other transactions and then draw edges using Precedence Graph.
Precedence Graph:
Loop occurred i.e T1 --T2 -- T2 --T1 means it is not a conflict serializable

No comments:

Post a Comment

Conflict Serializability

Find out conflict serializability for the given transactions T1 T2 T3 R(X)     ...