Metadata Caching and the Cache Manager
This section looks specifically at the caching of metadata for
RWDBTable and
RWDBStoredProc. Three main classes are involved in metadata caching.
RWDBCacheManager. Encapsulates the interface of a cache manager that stores and retrieves metadata for tables and stored procedures.
RWDBTableEntry. Represents the cacheable metadata for an
RWDBTable. Its methods allow you to set, retrieve, check the existence of, and clear the cacheable metadata. It also supplies operators for persisting and restoring the metadata.
RWDBStoredProcEntry. Represents the cacheable metadata for an
RWDBStoredProc, and has comparable methods to
RWDBTableEntry.
Before we get started, it would avoid confusion to discuss a bit of terminology.
Local cache. Some cacheable data is stored in local variables in the
RWDBTable or
RWDBStoredProc object it is associated with. We will refer to this data as being in the local cache.
Global cache. By this we will mean the data stored in the
RWDBCacheManager-derived instance associated with a particular
RWDBDatabase instance. Note that your application could have multiple
RWDBDatabase instances, each with its own “global” cache, so in a sense it is not truly global. Just understand that we are referring to the cache for some particular
RWDBDatabase instance.
The remainder of this section covers the following topics:
Example . An extended example demonstrating use of the Rogue Wave in-memory cache manager implementation and how it affects data retrieval times.