Sets a cache policy for a specified federated system. This is a global setting, and will affect all users and all sessions for this system.

Syntax

SET CACHEPOLICY FOR 'systemName' <cachePolicyOption>;

<cachePolicyOption> ::=
   {
      UPDATETIME [ OPTIONS ( READTIMEOUT_MS 'timeInMS' ) ] |
      ACCEPTABLE_WINDOW [ OPTIONS ( WINDOWTIMEOUT_SEC 'timeInSec' ) ] |
      OFF
   }

Arguments

  • systemName: Case-sensitive name of the existing federated system.

  • UPDATETIME: Compares the creation time of the cached object to the last update time of the source object. If the source object has changed/is more current than the cached object, the source object will be used, and the cached object will be discarded.

  • READTIMEOUT_MS: Controls how long the system waits to retrieve the last update time for the source object from the source system. If READTIMEOUT_MS is set to 0, then the system will wait forever to try to retrieve the last update time of the source object.

  • ACCEPTABLE_WINDOW: Compares the creation time of the cached object to the current time. If the current time is less than the creation time of the cache item plus the WINDOWTIMEOUT_SEC value, then the cached object is considered valid and can be used. Otherwise, the cached object is discarded and the source object will be retrieved from the source system. OFF: Removes any previously set cache policy for this system.

Examples

--turn off caching for a specific system's data
SET CACHEPOLICY FOR 'ORACLE1' OFF;
 
/* Use the UPDATETIME cache policy type, but ignore cache and use the source if the last update time cannot be retrieved in 20 milliseconds. */
SET CACHEPOLICY FOR 'ORACLE1'
UPDATETIME OPTIONS( READTIMEOUT_MS '20' );
 
/* Use the UPDATETIME cache policy type and never time out (wait forever to retrieve the last update time). */
SET CACHEPOLICY FOR 'ORACLE1'
UPDATETIME OPTIONS( READTIMEOUT_MS '0' );
 
/* use the ACCEPTABLE_WINDOW cache policy type, so cached objects can be used for up to 30 seconds after they are created.*/
SET CACHEPOLICY FOR 'ORACLE1'
ACCEPTABLE_WINDOW OPTIONS ( WINDOWTIMEOUT_SEC '30' );