Skip to main content

What is the difference between blocking and deadlocking?

Expert MS SQL
Quick Answer Blocking: transaction A waits for transaction B to release a lock รขโ‚ฌโ€ eventually resolves when B commits or rolls back. Deadlock: two transactions each hold what the other needs รขโ‚ฌโ€ neither can proceed without intervention. SQL Server resolves deadlocks by killing one victim. Blocking is slow; deadlocks are forced terminations.

Answer

Blocking occurs when one transaction holds a lock and others wait behind it.

Deadlock occurs when two transactions wait on each other, creating a cycle.

SQL Server detects deadlocks and kills one transaction (the victim) to resolve the cycle.

S
SugharaIQ Editorial Team Verified Answer

This answer has been peer-reviewed by industry experts holding senior engineering roles to ensure technical accuracy and relevance for modern interview standards.

Want to bookmark, take notes, or join discussions?

Sign in to access all features and personalize your learning experience.

Sign In Create Account

Source: SugharaIQ

Ready to level up? Start Practice