Client cache service¶
Since Sculptor version |
Contents
Idea¶
The idea is to cache the remote data in a local keyed file. The remote data may be coming from SQL/ODBC or sculptor keyed files.
The cache is useful when reading a file without a lock. And better when the remote file is not modified a lot (as the refresh check frequency can be reduced)
How to configure¶
To specify the file to cache and the type of cache to use a new set of attributes has been added to the ![o]file object.
The interface to the service has been implemented only in the Sculptor interpreters sage[c,w,wc,wcd]/srep[c,w,wc,wcd]
Refresh¶
If the cache data source is updated by other processes, the cache has to be discarded and reloaded. This process is called refresh. The refresh process can be cofigured with the ![o]file cache_auto_refresh attributte or manually triggered with the refresh_cache command.
Access or All cache¶
There are two types of cache with regard to how the file cache is filled:
All cache Filled with all the source data when it is first opened from the source (KfServer or ODBC source). Defined using the CACHE_ALL on the ![o]file cache_option attributte.
Access cache Filled with data when it is first fetched from the source (KfServer or ODBC source). Defined using the CACHE_ACCESS on the ![o]file cache_option attributte.
With an Access cache when a read operation in the cache fails, it tries to fetch it on the source, while on the All cache when a read fails, the read returns NSR.
The next, prev, find, match, count,… take profit of an All cache but not an Access cache.
Example¶
An example is provided to show the use of the client cache.