DF_DATABASE_MAX_ACTIVE_STATEMENTS

The maximum number of concurrently active statements allowed per connection. 0 (zero) means there is no limit.

Level

Database

Supported by

ODBC only, revision 5 and higher

Type

Integer, temporary

Access

Read/Write

Values

0..

Syntax

Use cli.pkg

 

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

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

Driver Configuration Keyword

Max_Active_Statements

Remarks

The maximum number of concurrently active statements allowed per connection. 0 (zero) means there is no limit.

This attribute can be queried through ODBC, but we have found that some drivers do not return a reliable value. The value of the attribute is used by the driver to determine the size of the statement pool. The driver keeps track of the statements that are used per connection in a 'Most Recently Used' sorted list. If the maximum number of statements is in use, the least recently used statement will be freed whenever an additional statement is required.

Some ODBC drivers return a value of 1 for this attribute. This will make the driver free and re-allocate statements all the time. For some drivers, the value is accurate (MS Jet Engine DataFlex ODBC Driver e.g.) but for others it is not (Oracle ODBC driver e.g.).

Procedure ShowDBAttribute Integer iDriver Handle hDatabase

    Integer iAttribValue

    Get_Attribute DF_DATABASE_MAX_ACTIVE_STATEMENTS of iDriver hDatabase to iAttribValue      

    Showln "Max active statements per connection: " (If(iAttribValue = 0, " unlimited", String(iAttribValue)))

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.