Oracle ORA-00060 Deadlock Explained: Causes, Detection, and Fixes
ORA-00060 is an Oracle database error triggered when two sessions enter a circular wait, each holding a lock the other needs. Oracle automatically detects this deadlock within seconds and resolves it by rolling back a single DML statement from one session, designated the victim, while the other session proceeds normally. Crucially, the victim's entire transaction is not rolled back — only the one statement that completed the cycle is undone, and all prior changes remain intact with their locks held. Applications must explicitly handle ORA-00060, as PL/SQL has no built-in exception for it; developers should use PRAGMA EXCEPTION_INIT to catch the error and implement retry logic. Deadlocks differ fundamentally from ordinary blocking, which involves a one-way wait and produces no error — a distinction critical to diagnosing session hang issues correctly.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in