Database-Management-System
August 29, 2024Database-Management-System
August 29, 2024Database-Management-System
|
Question 737
|
When transaction T i requests a data item currently held by T j , T j is allowed to wait only if it has a timestamp smaller than that of T j (that is, T i older than T j ). Otherwise, T i is rolled back(dies). this is
|
Wait-die
|
|
|
Wait-wound
|
|
|
Wound-Wait
|
|
|
Wait
|
Question 737 Explanation:
Wait-Die method
In this method, if a transaction requests to lock a resource (data item), which is already held with a conflicting lock by another transaction, then one of the two possibilities may occur −
● If TS(T i ) < TS(T j ) − that is T i , which is requesting a conflicting lock, is older than T j − then T i is allowed to wait until the data-item is available.
● If TS(T i ) > TS(t j ) − that is T i is younger than T j − then T i dies. T i is restarted later with a random delay but with the same timestamp.
This method allows the older transaction to wait but kills the younger one.
In this method, if a transaction requests to lock a resource (data item), which is already held with a conflicting lock by another transaction, then one of the two possibilities may occur −
● If TS(T i ) < TS(T j ) − that is T i , which is requesting a conflicting lock, is older than T j − then T i is allowed to wait until the data-item is available.
● If TS(T i ) > TS(t j ) − that is T i is younger than T j − then T i dies. T i is restarted later with a random delay but with the same timestamp.
This method allows the older transaction to wait but kills the younger one.
Correct Answer: A
Question 737 Explanation:
Wait-Die method
In this method, if a transaction requests to lock a resource (data item), which is already held with a conflicting lock by another transaction, then one of the two possibilities may occur −
● If TS(T i ) < TS(T j ) − that is T i , which is requesting a conflicting lock, is older than T j − then T i is allowed to wait until the data-item is available.
● If TS(T i ) > TS(t j ) − that is T i is younger than T j − then T i dies. T i is restarted later with a random delay but with the same timestamp.
This method allows the older transaction to wait but kills the younger one.
In this method, if a transaction requests to lock a resource (data item), which is already held with a conflicting lock by another transaction, then one of the two possibilities may occur −
● If TS(T i ) < TS(T j ) − that is T i , which is requesting a conflicting lock, is older than T j − then T i is allowed to wait until the data-item is available.
● If TS(T i ) > TS(t j ) − that is T i is younger than T j − then T i dies. T i is restarted later with a random delay but with the same timestamp.
This method allows the older transaction to wait but kills the younger one.
