Skip to content

DF_DATABASE_LOCK_STATE

The SQL Status codes that are generated when a deadlock or lock timeout error occurs.

Level

Database

Supported by

The DataFlex SQL Drivers (SQL Server, DB2, and ODBC), revision 5 and higher.

Type

String, temporary

Access

Read/Write

Values

SQL status codes separated by |.

Syntax

Use cli.pkg
Get_Attribute DF_DATABASE_LOCK_STATE of {driverNumber} {databaseHandle} to {StringVariable}
Set_Attribute DF_DATABASE_LOCK_STATE of {driverNumber} {databaseHandle} to {StringVariable}

Driver Configuration Keyword

Lock_State

Remarks

The SQL Status codes that are generated when a deadlock or lock timeout error occurs. When an error occurs with a status code in this list, the error will be translated to the DataFlex lock timeout error, thus enabling the automatic retry mechanism.

The string can hold multiple SQL status codes; if this occurs, they will be separated by the | character. For example, if a back end generates SQL status codes XY0001 and DF0002 in case of a deadlock and lock timeout, the DF_DATABASE_LOCK_STATE should be set to |XY0001|DF0002|.

Procedure ShowDBAttribute Integer iDriver Handle hDatabase
    String sAttribValue
    Get_Attribute DF_DATABASE_LOCK_STATE of iDriver hDatabase to sAttribValue
    Showln "Lock SQL State(s): " sAttribValue
End_Procedure

The sample code above shows the current setting for a given database. The database handle can be obtained via the DF_DATABASE_ID attribute.