Using lock wait

Considerations for using lock wait.

  • By default, an SAP ASE task that cannot immediately acquire a lock waits until incompatible locks are released, then continues processing. This is equivalent to set lock wait with no value specified in the numsecs parameter.
  • You can set a server-wide lock wait period by using sp_configure with the lock wait period option.

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

  • A lock wait period defined at the session level or in a stored procedure with the set lock command overrides a server-level lock-wait period.

  • If set lock wait is used by itself, with no value for numsecs, all subsequent commands in the current session wait indefinitely to acquire requested locks.

  • sp_sysmon reports the number of times that tasks waiting for a lock could not acquire the lock within the waiting period.