Page History
18.8.1 Lock Timeout Configuration
Lock Timeout Types
There are two different methods of setting a timeout for when an SQL transaction is waiting for a lock to be freed by another process. They are:
1. For a Connection Lock Timeout supported on Windows and IBM i (but not on Linux) for all LANSA development databases: SQL Server, Oracle and Sybase Adaptive Server Anywhere, set a timeout on each connection so that ANY locks that occur on that connection can return control back to the application.
2. For Oracle on Linux, a different technique is required. In this environment, a wait time can be set on the SELECTs executed before LANSA performs an UPDATE or DELETE. This is called a Statement Lock Timeout. LANSA also supports this setting on Oracle for Windows so that an application can expect consistent lock timeout behavior when running on either Windows or Linux.
...
LOCK_TYPE=C
LOCK_TIMEOUT=2
CMD_LOCK_TIMEOUT=<setting ignored>
DBMS_RETCODE_ROW_LOCKED=1013
| Anchor | ||||
|---|---|---|---|---|
|
The Statement Lock Timeout is specific to Oracle. It allows the same lock timeout behavior to occur on Windows and Linux Oracle databases.
...
LOCK_TYPE=S
LOCK_TIMEOUT=2
CMD_LOCK_TIMEOUT=FOR UPDATE NOWAIT
DBMS_RETCODE_ROW_LOCKED=54
| Anchor | ||||
|---|---|---|---|---|
|
For Windows, Linux servers, the Client and Server must have the same timeout settings in x_dbmenv.dat for the database type used on the server (LOCK_TYPE, LOCK_TIMEOUT, CMD_LOCK_TIMEOUT, and DBMS_RETCODE_ROW_LOCKED). Otherwise, *DBMS_RECORD_LOCKED may return N when you expect it to return Y.