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:
*Types of Cacheable Data . The types of data that can be cached, and how the caching mechanism works.
*Using the Cache Manager . How to create and use a cache manager, and certain restrictions on that use.
*Error Handling in the Cache Manager . How errors that may occur within the cache manager are handled by the DB Interface Module.
*Keeping the Cache Up-To-Date . How cached data may become out-of-date and what to do about it.
*The In-Memory Cache Manager . The in-memory cache manager implementation supplied by Rogue Wave and how to use it.
*Implementing a Cache Manager . How to implement a cache manager and considerations for that implementation.
*Example . An extended example demonstrating use of the Rogue Wave in-memory cache manager implementation and how it affects data retrieval times.