|
<< Click to Display Table of Contents >> Dead caching |
![]() ![]()
|
Dead caching may be used when live caching is not possible. With dead caching, the data may not be fresh. The following rules apply to dead caching:
| Dead caching is used - for passthrough queries; or - if no ordering exists; and - provided that the statement property stmtLIVENESS is not set to wantLIVE |
| Dead caching is used for DbiOpenTable if no index is available and the server does not support row IDs, or if iIndexId is set to NODEFAULTINDEX with DbiOpenTable. |
| Dead caching keeps a full client snapshot cache. As records are read from the server, they are stored locally in case they are needed again. |
| Dead caching provides no cache refresh. You must close and re-open the table, or re-execute a query to see new data. |
| Since there is no key, key operations (such as DbiSetRange and DbiSetToKey) are not supported. Other navigation functions such as DbiSetToBookMark are supported. |
Record caching example: dead
The SQL driver finds some basic information about the Customer table structure, but no data is retrieved:
ID |
Name |
11001 |
Mary |
10000 |
John |
12666 |
Joe |
12321 |
Harry |
12345 |
Beth |
DbiOpenTable (
| hDb, |
| "Customer", |
| NULL, |
| NULL, |
| ..., |
| &hCursor ...); |
DbiGetNextRecord (...)
The SQL driver executes a query:
SELECT Id, Name
FROM Customer
The SQL driver caches a row:
ID |
Name |
11001 |
Mary |
DbiGetNextRecord (...)
The SQL driver caches another row:
DbiGetPriorRecord (...)
The SQL driver uses a cache:
DbiSetToBegin (...)
The SQL driver leaves the query and cache alone:
ID |
Name |
11001 |
Mary |
10000 |
John |
12666 |
Joe |