Sybase Technical Library - Product Manuals Home
[Search Forms] [Previous Section with Hits] [Next Section with Hits] [Clear Search] Expand Search

Error 1204 [Table of Contents] Error 1243

Troubleshooting and Error Messages Guide

[-] Chapter 3 Error Message Writeups
[-] Lock Manager Errors
[-] Error 1205

Error 1205

Severity

13

Error message text

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

Explanation

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 the other users' processes to move forward.

Deadlocks are caused by a number of situations, including:

Action

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.

Application Error Handling

Each application should have deadlock handling routines. Refer to the dbsetuserdata entry in the Open Client DB-Library Reference Supplement for a sample deadlock handling routine.

Use 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 Manager" in the System Administration Guide.

Versions in which this error is raised

All versions


Error 1204 [Table of Contents] Error 1243