Manually or Dynamically Loading Cache Groups

You define whether your cache group is manually or dynamically loaded during cache group definition.

Note:

A static cache group is one that is created without the DYNAMIC keyword. Static cache groups are supported in both TimesTen Classic and TimesTen Scaleout. See Using Cache Groups in TimesTen Scaleout in the Oracle TimesTen In-Memory Database Scaleout User's Guide.

A dynamic cache group is created with the DYNAMIC keyword. Dynamic cache groups are only supported in TimesTen Classic.

  • Manually loaded: You can manually load data into either a static cache group or a dynamic cache group. You will always manually load data into a static cache group. Perform the initial load of data into either static or dynamic cache groups from cached Oracle Database tables using a LOAD CACHE GROUP statement.

  • Dynamically loaded on demand: For dynamic cache groups only, TimesTen can dynamically load data on demand. Data is automatically loaded into the TimesTen cache tables from the cached Oracle Database tables when a qualifying SELECT, INSERT, UPDATE, or DELETE statement is issued on one of the cache tables and the data does not exist in the cache table but does exist in the cached Oracle Database table.

With both static and dynamic cache groups, a LOAD CACHE GROUP statement manually loads into the designated cache tables qualified data that exists in the cached Oracle Database tables but not in the cache tables in TimesTen. However, if a row exists in a cache table but a newer version exists in the cached Oracle Database table, a LOAD CACHE GROUP statement does not load that row into the cache table even if it satisfies the predicate of the statement.

By contrast, a REFRESH CACHE GROUP statement manually reloads qualifying rows that exists in the cache tables, effectively refreshing the content of the cache. For a static cache group, the rows that are refreshed are all the rows that satisfy the predicate of the REFRESH CACHE GROUP statement. However, for a dynamic cache group, the rows that are refreshed are the ones that satisfy the predicate and already exist in the cache tables. In other words, rows that end up being refreshed are the ones that have been updated or deleted in the cached Oracle Database table, but not the ones that have been inserted. Therefore, a refresh operation processes only the rows that are already in the cache tables. No new rows are loaded into the cache tables of a dynamic cache group as a result of a refresh.

The data in the cache instance of a dynamic read-only cache group is consistent with the data in the corresponding rows of the Oracle Database tables. At any instant in time, the data in a cache instance of a static cache group is consistent with the data in the corresponding rows of the Oracle Database tables, taking into consideration the state and the interval settings for autorefresh.