Skip to content

DF_DRIVER_USE_DF_LOCKERROR

Indicates whether deadlock and lock timeout errors should be translated to DFERR_LOCK_TIMEOUT.

Level

Driver

Supported by

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

Type

Boolean, temporary

Access

Read/Write

Values

  • True
  • False

Syntax

Use cli.pkg
Get_Attribute DF_DRIVER_USE_DF_LOCKERROR of {driverNumber} to {BooleanVariable}
Set_Attribute DF_DRIVER_USE_DF_LOCKERROR of {driverNumber} to {True|False}

Driver Configuration Keyword

Use_DF_Lockerror

Remarks

Indicates what error will be generated in case of a deadlock/lock timeout error. If True, DFERR_LOCK_TIMEOUT (error 4106 "Locktime-out") will be generated. This will trigger the built-in automatic retry mechanism. If set to False, CLIERR_DEADLOCK_OR_TIMEOUT (error 12303 "Deadlock or timeout") will be generated.

Example Code

The sample code below shows the current setting for a given driver.

Function DriverIndex String sDriver Returns Integer
    String  sCurrentDriver
    Integer iNumberOfDrivers iDriver iCount
    Move 0 to iDriver
    Get_Attribute DF_NUMBER_DRIVERS to iNumberOfDrivers
    For iCount From 1 To iNumberOfDrivers
        Get_Attribute DF_DRIVER_NAME of iCount To sCurrentDriver
        If (Uppercase(sCurrentDriver) = Uppercase(sDriver)) Begin
            Move iCount to iDriver
        End
    Loop
    Function_Return iDriver
End_Function // DriverIndex

Procedure ShowDriverAttribute
    Boolean bAttribValue
    Integer iDriver
    Get DriverIndex "MSSQLDRV" To iDriver
    Get_Attribute DF_DRIVER_USE_DF_LOCKERROR of iDriver to bAttribValue
    Showln "Translate lock errors: " (If(bAttribValue, "YES", "NO"))
End_Procedure