View Confloct Serializability
View Confloct Serializability
Serializability
•
Example –
Let us consider the following schedule and see if it is serializable.
T1 T2
R(X)
R(X)
R(Y)
W(Y)
R(Y)
fi
fl
W(X)
Now, let
us gure
out if the
above
schedule
is
serializabl
e.
1.
Swapping
R(X)
of T1
and
R(Y)
of
T2. 2
Swapping
R(X)
of T1
and
W(Y
) of
T2.
fi
T1 T2
R(X)
R(Y)
W(Y)
R(X)
R(Y)
W(X)
Thus, after
changing
the
con icting
operations
in the
initial
schedule
we get a
serial
schedule.
Hence,
this
schedule
is
serializabl
e.
Types of
Serializab
le
Schedules
:
1.
Result
Equi
valen
t
Sche2
fl
Con ict
Equi
valen
t
Sche
dule
or
Con
ict
Seria
lizabi
lity
3
View
Equi
valen
t
Sche
dule
or
View
Seria
lizabi
lity
f
fl
Differenc
e between
Con ict
and View
Serializab
ility :
If a schedule is
If a schedule is view
con ict serializable
serializable then it
2 then it is also view
may or may not be
serializable
con ict serializable.
schedule.
Example
for
Con ict
Serializab
ility –
Let us
consider
the
following
transaction
schedule
and test it
for
Con ict
Serializabi
lity
fl
fl
Now, we
will list all
the
con icting
operations
. Further,
we will
determine
whether
the
schedule
is con ict
serializabl
e using
Precedenc
e Graph
.
Two
operations
are said to
be
con icting
if the
belong to
different
transaction
, operate
on same
data and at
least one
of them is
a write
operation.
fl
fl
fl
1.
R3(X) and
W2(
X)
[ T3
-> T2
] 2
W1(Y)
and
R3(Y
) [ T1
-> T3
] 3
W1(Y)
and
W2(
Y)
[ T1
-> T2
] 4