Q&A
Q&AWhat is a safe application response to a database deadlock victim error?
Retry the whole idempotent transaction within a bounded policy, not just an arbitrary statement.
Read the concise answer
A deadlock detector aborts one transaction so another can progress. Capture lock and query evidence, then retry the whole business transaction only if its effects are safe to repeat. Use bounded attempts with jitter, consistent resource ordering, and idempotency for any external side effects.