hi, have three transactions:
tran1 (sessionid = 59):
tran2 (sessionid = 57):
tran3 (sessionid = 55):
I use below statements to find out the lock informations:
and my instance on a virtual pc only one cpu.my questions is: why the wait status of tran2 is still 'WAIT'(it is blocked by tran1), but the tran3 is blocked by tran2?
The simple answer is because blocks are chained. At first, a transaction will look to see if there is an existing blocking chain waiting for the resources it needs. If there is, it get's added to the tail of the blocking chain. If not, then it checks to see if it can acquire all locks it needs. If it can't it starts a new blocking chain.
That's a huge over-simplification, but it gives you the general idea. So...
answered Apr 13 '11 at 03:23 AM
Matt Whitfield ♦♦
So because tran2 has not been granted any resources yet, it is WAITing whereas tran3 has some resources so is BLOCKED: http://msdn.microsoft.com/en-us/library/ms190345.aspx