Topic
Transactions, isolation, locking, blocking, deadlocks, optimistic concurrency, and race-condition prevention.
Practice items tagged with SQL Transactions and Locking.
Chooses constraints, conditional writes, optimistic conflicts, or stronger isolation to protect a limited-resource reservation without unnecessary blocking.
Builds a race-safe upsert around database-enforced identity, explicit conflict semantics, retries, ordering, and side-effect boundaries.
Separates a live blocking chain from a deadlock victim, gathers the right database evidence, stabilizes the incident, and fixes lock duration or access order.
Ranks duplicate import rows, previews the deletion set, and removes older copies with deterministic retention.
Uses a conditional update and transaction to prevent overselling while recording the reservation consistently.
Prevents lost updates with an original rowversion predicate, maps zero affected rows to an explicit conflict, and defines user, retry, aggregate, and API precondition behavior.