Error 1205



Message text

Your server command (family id #%d, process id #%d) encountered a deadlock situation. Please re-run your command. 


This error occurs when a process tries to acquire a lock on an object that is locked by a second process when the second process is waiting for a lock on an object that has been locked by the first process. This situation is a deadlock, and can involve more than two processes.

Adaptive Server detects this situation, rolls back the transaction that has accumulated the least amount of CPU time, and notifies the application program of this action with error 1205. This allows other users’ processes to move forward.

Deadlocks are caused by a number of situations, including:


Restart the transaction that has been rolled back. To minimize future occurrences of deadlocks, use any of the following procedures that apply to your site.

Handling application errors

Each application should have deadlock handling routines. Refer to dbsetuserdata in the “Routines” chapter of the most recent version of the Open Client DB-Library/C Reference Manual (within the Open Server 15.0, Open Client 15.0 and SDK 15.0 top-level topic on the Sybase Technical Library Product Manuals Web site) for a sample deadlock handling routine.

Using well-constructed transactions

Using transactions constructed to avoid deadlocks greatly reduces their occurrence. Some techniques for writing transactions that avoid deadlock include:

Additional information

Refer to “Lock management” in the most recent version of Performance and Tuning: Monitoring and Analyzing.

Versions in which this error is raised

All versions