Keeping the Cache Up-To-Date
There is always a possibility that the data held in the cache may become inconsistent with the actual state of the database. In this case, Rogue Wave classes and methods that rely on the cache may execute with stale data.
The mechanism that Rogue Wave supplies for re-establishing consistency is through clearCache() methods in the classes that use the cache: RWDBTable and RWDBStoredProc. These methods take an enum value as a parameter: Local or All. The Local option clears only the local cache variables in the calling object. The All option clears the local cache variables and the cached data associated with the calling object in the global cache.
Calling clearCache() with All guarantees that the next time the data is needed, it is refreshed by a query to the database. Using the Local option refreshes the local cache the next time the data is needed, but the data may come from the global cache, not necessarily from the database.
Note that Rogue Wave classes and methods never call clearCache() on their own. It is up to you to decide when there might be a danger of the cache becoming out-of-date, and to call these methods to set it right. We recommend that you clear the cache any time you change the database in a way that affects cached metadata.
NOTE: The forcedLookup parameters on some RWDBTable and RWDBStoredProc methods, the previous API for updating cached metadata, are deprecated but maintained for backward compatibility.