Question

This may seem a bit dull question but does blocking always mean that there is open transaction and that may cause transaction log grow to infinity because open transaction prevents log truncation (database in SIMPLE mode)?

Was it helpful?

Solution

No.

If you try the following from two different connections then the second one will be blocked by the first (visible in sys.dm_os_waiting_tasks) but neither will result in any transaction log activity and running DBCC OPENTRAN will report "No active open transactions" (assuming no other activity).

SELECT COUNT_BIG(*)
FROM master..spt_values v1 WITH (TABLOCKX),
     master..spt_values v2 WITH (TABLOCKX),
     master..spt_values v3 WITH (TABLOCKX),
     master..spt_values v4 WITH (TABLOCKX)
Licensed under: CC-BY-SA with attribution
Not affiliated with dba.stackexchange
scroll top