DF_DATABASE_NUMBER_NATIVE_LOCKERRORS

The number of 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

0..

Syntax

Use cli.pkg

 

Get_Attribute DF_DATABASE_NUMBER_NATIVE_LOCKERRORS of {driverNumber} {databaseHandle} to {IntegerVariable}

Set_Attribute DF_DATABASE_NUMBER_NATIVE_LOCKERRORS of {driverNumber} {databaseHandle} to {IntegerVariable}

Driver Configuration Keyword

None

Remarks

The number of 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.

Error number are added to the list by setting the DF_DATABASE_NATIVE_LOCKERROR attribute. The list can be emptied out by setting the DF_DATABASE_NUMBER_NATIVE_LOCKERRORS attribute to 0 (zero).

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                                                          

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