Lock Manager Errors

This section contains error messages for the Adaptive Server Lock Manager.




Error 1203

Severity

20

Message text

Caller of lock manager is incorrectly trying to unlock an unlocked object. spid=%d locktype=%d dbid=%d object id or page number=%ld.

Explanation

Before the Lock Manager tries to unlock an object, it checks to make sure the object is in fact locked. When an object is not locked during this check, Error 1203 occurs.

This error is usually due to an Adaptive Server problem which causes an incorrect session descriptor pointer or logical page number to be passed to the Lock Manager.

Error 1203 can occur during an insert, update, or select, particularly on a table with an index.

Action

Call Sybase Technical Support.

Additional information

Before calling Technical Support, have the following information available:

Versions in which this error is raised

All versions




Error 1204

Severity

19

Message text

SQL Server has run out of LOCKS. Re-run your command when there are fewer active users, or contact a user with System Administrator (SA) role to reconfigure SQL Server with more LOCKS.

Explanation

This error occurs when Adaptive Server runs out of locks . The number of locks available is controlled by the Adaptive Server configuration parameter number of locks.

Following is an example of the output from sp_configure, and a brief description of the output related to locks:

1> sp_configure "number of locks"
2> go

Parameter Name        Default     Memory Used Config Value Run Value 
--------------------- ----------- ----------- ------------ ----------- 
number of locks             5000           0        5000        5000

Action

Rerun the command when there are fewer active users, or ask the Sybase System Administrator (“sa”) to reconfigure Adaptive Server for more locks. Increasing the number of available locks impacts performance and memory requirements.

WARNING! Before making any changes to Adaptive Server, refer to the Performance and Tuning Guide and “Configuring Memory” in the System Administration Guide for information about how Adaptive Server uses memory resources.

To increase the number of locks available, complete the following steps:

  1. Determine the number of locks currently configured for Adaptive Server:

    1> use master 
    2> go
    

    1> sp_configure "number of locks"
    2> go
    

    WARNING! If you increase the number of locks available by too many locks, Adaptive Server may run out of memory and be unable to restart. Refer to Chapter 1, “Adaptive Server Does Not Start After Altering Configuration” if you run out of memory and cannot restart Adaptive Server.

  2. Choose the number of locks you want to configure and issue the following command:

    1> sp_configure "number of locks", new_value
    2> go
    

  3. Restart Adaptive Server to operate with the new values.

Additional information

Refer to the Performance and Tuning Guide for information about locks and other Adaptive Server resources.

Refer to “number of locks” in the System Administration Guide for information about the number of locks configuration parameter.

Versions in which this error is raised

All versions




Error 1205

Severity

13

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 1243

Severity

26

Message text

Couldn't find object to be released.

Explanation

When Adaptive Server no longer needs a lock, it releases it. Error 1243 occurs when Adaptive Server cannot find the object for the lock to be released. It occurs with the following states:

State

Meaning

1

Adaptive Server uses address locks to lock memory addresses for buffers containing OAM and allocation pages. If, during the release of an address lock, Adaptive Server fails to find one of the buffers, Error 1243 occurs with State 1.

2

Adaptive Server uses logical locks for database pages and tables. The server searches for the logical lock before releasing it. If, during the release of a logical lock, the server fails to find the requested object on the lock chain, Error 1243 is raised with State 2.

Action

Shut down and restart Adaptive Server.

NoteSince the unreleased lock may be an exclusive lock, there may be some objects you cannot access until you restart Adaptive Server.

If Error 1243 occurs again, call Sybase Technical Support.

Versions in which this error is raised

All versions




Error 1249

Severity

20

Message text


Version 11.5 and later

 Process became runnable before lock it was waiting for was released.


Version 11.0.x and earlier

Process (spid=%d) became runnable before lock it was waiting for was released. This is an unexpected lock manager error. Please contact Technical Support and provide them the information logged in the errorlog.

Explanation

The Lock Manager maintains queues of lock requests to enable server tasks to obtain read, write and update locks as needed. A task sleeps while waiting for a lock request to be granted. Error 1249 is raised when the task awakes but the Lock Manager detects an abnormal condition in the lock queue for that lock. Error 1249 is raised in the following states:

State

Meaning

1

The lock request was granted, but the lock is not at its expected position in the queue.

2

The lock received a signal to requeue, but it is not at its expected position in the queue.

Error 1249 is caused by an Adaptive Server problem and breaks the connection to the server. In a common scenario leading to this error, separate sessions open cursors on the same table, and the user aborts one session in the middle of an update; attempting the same transaction again raises the 1249 error.

Action

Call Sybase Technical Support.

Additional information

Have the following information ready when you call Sybase Technical Support:

Versions in which this error is raised

All versions




Error 1265

Severity

20

Message text

A lock manager routine expected a lock record as an argument but was passed something else. lr=0x%x, lrmagic=%c.

Explanation

This error occurs when the Adaptive Server Lock Manager is:

and the lock record structure is not valid.

This error is usually due to an Adaptive Server problem.

Action

Shutting down and restarting Adaptive Server will usually clear the 1265 error. If it does not clear the error or if the error occurs repeatedly, call Sybase Technical Support.

Additional information

Before calling Technical Support, have the following information available:

Versions in which this error is raised

All versions




Error 1279

Severity

16

Message text

SQL Server has run out of locks on engine %d. Re-run your command when there are fewer active users, or contact a user with System Administrator (SA) role to reconfigure maximum engine freelocks or number of locks.

Explanation

An Adaptive Server engine is a process running an Adaptive Server that communicates with other Adaptive Server processes via shared memory. An Adaptive Server running on a multiprocessor machine can have one or more engines.

Adaptive Server uses two configuration parameters to control lock use:

Adaptive Server maintains a list of Server-wide free locks and a list of per-engine free locks. When locks are needed for an engine, Adaptive Server moves a block of free locks from the Server-wide free lock list to the free lock cache for that engine.

Error 1279 occurs when Adaptive Server runs out of locks on an engine and is unable to move any more locks from the Server-wide free list but there is an another engine with some free locks. (Error 1204 occurs when Adaptive Server completely runs out of locks.) The error message includes the number of the engine that has run out of locks.

Action

Run your command again later when there are fewer active users or increase the number of locks available to the engine. If you want to increase the resources, you can do one of the following:

Additional information

Refer to “Lock Manager” in the System Administration Guide for information about Adaptive Server engines and the Adaptive Server Lock Manager.

Refer to the Reference Manual for information about sp_configure and configuration parameters.

Refer to the Performance and Tuning Guide for information about memory management for Adaptive Server.

Versions in which this error is raised

All versions