In order to reduce the number of database queries, commonly and recently used database objects are held in a cache. The server will retrieve objects from this cache in preference to retrieving them from the database.
Each entry in the cache contains the database object and its last modified date at the time the cache entry was added. Every time an object is accessed this date is compared against the database and if found to be different, the cache entry is updated with the newer object.
Some objects are held permanently in the cache, others are removed when they haven't been accessed for a specified period of time. In either case, the database (the table gn_AuditSnapshotTable that holds the last modified date for an object. This is maintained only for object types defined in the server cache configuration) is always checked first to ensure that the cache version is uptodate.
The ServerCache is controlled by the separate configuration object called ServerCacheConfig.
Loading and unloading server cache
Use cmd4 to import, e.g.
cmd4 config -in ..\config\global\ServerCacheConfig.xml -username xxxx -password -yyyy
where xxxx is the name of a GN4 user who can logon to system with sufficient permissions to perform this operation and yyyy is the password.
Note: the above connects to the default connection: should you want to specify the connection or server name, see cmd4 examples.
To disable the server cache, simple removed the ServerCacheConfig object from the database, e.g.
cmd4 config -in "" -name ServerCacheConfig -username xxxx -password -yyyy
where xxxx is the name of a GN4 user who can logon to system with sufficient permissions to perform this operation and yyyy is the password.
Note: the above connects to the default connection: should you want to specify the connection or server name, see cmd4 examples.
It is important to restart all the services so that any changes to the ServerCacheConfig can be reloaded.
Server cache logging
You can enable ServerCache logging using ServerCache LogEvents name in appSettings section:
<add key="Db.LogEvents" value="ServerCache"/>