Locking Commands and Options

SAP ASE allows you to specify a lock wait period or use readpast locking to silently skip all incompatible locks, without blocking, terminating, or generating a message.

Set a Time Limit on Waiting for Locks

  • You can use the wait or nowait option of the lock table command to specify a time limit on waiting to obtain a table lock.

  • During a session, you can use the set lock command to specify a lock wait period for all subsequent commands issued during the session.

  • The sp_configure parameter lock wait period, used with the session-level setting set lock wait nnn, is applicable only to user-defined tables. These settings have no influence on system tables.

  • Within a stored procedure, you can use the set lock command to specify a lock wait period for all subsequent commands issued within the stored procedure.

  • You can use the lock wait period option of sp_configure to set a server-wide lock wait period.