Dead caching

<< Click to Display Table of Contents >>

Navigation:  »No topics above this level«

Dead caching

Return to chapter overview

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:

_bm0        Dead caching is used
- for passthrough queries; or
- if no ordering exists; and
- provided that the statement property stmtLIVENESS is not set to wantLIVE
_bm0        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.
_bm0        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.
_bm0        Dead caching provides no cache refresh. You must close and re-open the table, or re-execute a query to see new data.
_bm0        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