The native error numbers that are generated when a deadlock or lock timeout error occurs.
Database
The DataFlex SQL Drivers (SQL Server, DB2 and ODBC), revision 5 and higher
Integer, temporary
Read/Write
Native error number
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}
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 setup 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).
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.