skip to main content
Using the driver : Client-Side Caches : Modifying a Cache Definition : Disabling and Enabling a Cache
  

Try DataDirect Drivers Now
Disabling and Enabling a Cache
When a cache is defined on a table, all fetch operations performed on that table access the cache, essentially hiding the remote table from the application. At times, you may want an application to query the remote data instead of the cached data.
Assume that a cache was created on the Account table with a filter set to cache accounts that have had activity in the past year. If you want to run a query to get information about an account that has not been active for two years, you can drop the Account cache, run the query, and then recreate the cache on Account, but this can be problematic. First, you must recreate the cache and make sure it had the same attributes as before. Second, the data in the cache is discarded and needs to be refetched when the cache is recreated. Depending on the amount of cached data, this could take a significant amount of time.
A better alternative is to temporarily disable a cache. When a cache is disabled, its definition and data are maintained. Any queries that reference a table with a disabled cache access the remote table. When you want to access cached data again, the cache can be enabled.