Skip to content

DF_DATABASE_NATIVE_LOCKERROR

The native error numbers 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

Integer, temporary

Access

Read/Write

Values

Native error number

Syntax

Use cli.pkg
Get_Attribute DF_DATABASE_NATIVE_LOCKERROR of {driverNumber} {databaseHandle} to {IntegerVariable}
Set_Attribute DF_DATABASE_NATIVE_LOCKERROR of {driverNumber} {databaseHandle} to {IntegerVariable}

Driver Configuration Keyword

Native_Lockerror

Remarks

The native error numbers that are generated when a deadlock or lock timeout error occurs. When an error occurs with an error number in this list, the error will be translated to the DataFlex lock timeout error, thus enabling the automatic retry mechanism.

It is possible to set up multiple error numbers. Every Set_Attribute command of this attribute will add the error number to the already existing list (if any). The list can be emptied out by setting the DF_DATABASE_NUMBER_NATIVE_LOCKERRORS attribute to 0 (zero).

Example

The sample code below shows the current list of native lock errors for a given database. The database handle can be obtained via the DF_DATABASE_ID attribute.

Procedure ShowDBAttribute Integer iDriver Handle hDatabase
    Integer iAttribValue
    Integer iNumAttributes
    Integer iAttribIdx

    Get_Attribute DF_DATABASE_NUMBER_NATIVE_LOCKERRORS of iDriver hDatabase to iNumAttributes
    Showln "Number of lock errors: " iNumAttributes

    For iAttribIdx From 0 To (iNumAttributes - 1)
        Get_Attribute DF_DATABASE_NATIVE_LOCKERROR of iDriver hDatabase iAttribIdx to iAttribValue
        Showln "  - Lock error: " iAttribValue
    Loop
End_Procedure