You are on page 1of 4

E×ERC1sr

QD

Ans > 17 If the transaction happen in the


following order :

Ii ) Transaction % executes WCY )

(Ii ) Transaction Ti executes RLY )

Liii ) Transaction T2 is aborted .

The value read by Ti would be invalid and the abort

would be cascaded to Ti .

2) Strict ZPL would require Tz to obtain an exclusive


Y writing to it This lock would have to
lock on
before
.

be held until T2 committed or aborted ; this would


block Ti
from reading Y until I was
finished ,
but there
would be no
interference .
927 .

Ans .

1) -

The schedule with actions


of transactions Ti and Tz

are

T, i RCX ) RLY ) WIX ) Commit

72 : RLX ) RLY ) WCX )w( Y ) commit

WCX ) of T, and RCX ) of Tz is a write - read

conflict
.

i. e ,
it reads the uncommited data

Therefore ,
the last transaction of T2 will be a dirty
read .

}
2 .
The schedule of transactions with read -
write

conflict :

T, : RLX ) RLY ) wlx)

Tz : RCX ) RCY ) WCX ) WCY )


In the transaction T, it tries to read '
X' and then
,

RLX ) and
'
in the transaction % ,
it tries to read '

write
'
X' WLX ) ,

write WCX) which will


Again T, tries ✗

cause an error .

After the execution of 7 ,


T2 will get an unrepeatable
read on ✗ .

3) -

The schedule
for write -
write conflict
-

Ti : Rlx ) RCY ) W( Y) Commit

Tz : Rlx ) RCY ) WLX ) WCY ) commit

Tz transaction write WLX ) on the un commit ed


data
of IT ,
and
again T, tries to overwrite the ✗

written arises in
which was
already by Tz .
The
conflict
that situation .

4) .

write -
Read conflict →
I will not
get shared lock on

✗ until T , commits

Read Write -

conflict → Ti will not get exclusive lock on ✗

until Tz commits

write -
Write conflict →
Ti will not
get exclusive lock on ✗

until T2 commits .
93) Give an example of schedule where there are two

deadlock
transactions and a is
generated .

A) ^
Actions of transactions Ti and T2 on ✗ and Y

Ti : RCX ) WLX ) RLY ) WLY )


, , ,

Tz : RCY ) WLY ) RLX ) WCX)


, , ,

Ti : ✗ ( ✗I Rlx ) WLX ) ✗ (4) RLY ) WH )

Tz : ✗ (Y ) RLYJWLY ) ✗ (X ) RLXJWCX )

T, transaction → ✗ (x ) which is the lock on ✗

In the second I transaction ✗ (Y) which has the lock on


,

Y .
In the transaction T , ,
T, waits
for the lock until T2
commits .

In the transaction Tz , Tz waits until the Ti commits .

Both the transactions wait they


for the lock so that

can write on X and Y .

This creates deadlock situation


a , as Tz waits for Ti
and waits Tz obtain the lock and write
Ti for to .

You might also like