DF_FILE_FINDCACHE_HITS, DF_FILE_FINDCACHE_TIMEOUTS
The number of find cache hits for the table.
Level
Table
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_FILE_FINDCACHE_HITS of {tableNumber} to {IntegerVariable}
Set_Attribute DF_FILE_FINDCACHE_HITS of {tableNumber} to {IntegerVariable}
Get_Attribute DF_FILE_FINDCACHE_TIMEOUTS of {tableNumber} to {IntegerVariable}
Set_Attribute DF_FILE_FINDCACHE_TIMEOUTS of {tableNumber} to {IntegerVariable}
Remarks
Two table-level attributes can be used to measure the effectiveness of the current find cache timeout setting. The attributes DF_FILE_FINDCACHE_HITS and DF_FILE_FINDCACHE_TIMEOUTS will return the number of cache hits (usage of cache) and timeouts (discarding the cache and getting data from the server), respectively. The find logic will increment the appropriate attribute when needed.
The attributes are kept in signed integer variables. Whenever incrementing the integer value of one of the attributes causes the value to become negative, both variables will be set to 0 (zero). It is possible to set the attributes to 0 (zero, the only allowed value). Setting one of the attributes will automatically cause the other attribute to be set to 0 (zero).
Example
The sample procedure below shows the hits and timeouts for every open table.
Procedure ShowFindCacheEffectiveness
Handle hTable
Integer iHits
Integer iTimeouts
String sName
Showln "Table, hits, Timeouts"
Move 0 To hTable
Get_Attribute DF_FILE_NEXT_OPENED Of hTable To hTable
While (hTable <> 0)
Get_Attribute DF_FILE_FINDCACHE_HITS Of hTable To iHits
Get_Attribute DF_FILE_FINDCACHE_TIMEOUTS Of hTable To iTimeouts
Get_Attribute DF_FILE_LOGICAL_NAME Of hTable To sName
Showln sName ", " iHits ", " iTimeouts
Get_Attribute DF_FILE_NEXT_OPENED Of hTable To hTable
End
End_Procedure // ShowFindCacheEffectiveness