Flushing a User Managed Cache Group

The FLUSH CACHE GROUP statement manually propagates committed inserts and updates on TimesTen cache tables in a user managed cache group to the cached Oracle Database tables.

A flush operation can manually propagate multiple committed transactions on cache tables to the cached Oracle Database tables. This statement is available only for user managed cache groups. Delete operations are not flushed or manually propagated.

Automatic propagation is initiated when you use the PROPAGATE cache table attribute when defining your cache group. TimesTen then automatically propagates committed inserts, updates and deletes at commit time to the Oracle database in the order that they are committed in TimesTen.

You cannot flush a user managed cache group with the FLUSH CACHE GROUP statement that uses the AUTOREFRESH cache group attribute.

You can flush a user managed cache group with the FLUSH CACHE GROUP statement if at least one of its cache tables uses neither the PROPAGATE nor the READONLY cache table attribute.

You can use a WHERE clause or WITH ID clause in a FLUSH CACHE GROUP statement to restrict the rows to be flushed to the cached Oracle Database tables.

The following example flushes a cache group with the FLUSH CACHE GROUP statement. It manually propagates committed insert and update operations on the TimesTen cache tables in the western_customers cache group to the cached Oracle Database tables:

FLUSH CACHE GROUP western_customers;

See FLUSH CACHE GROUP in Oracle TimesTen In-Memory Database SQL Reference.

The following example creates a user managed cache group with the PROPAGATE cache table attribute:

CREATE USERMANAGED CACHE GROUP updateanywherecustomers
AUTOREFRESH
       MODE INCREMENTAL
       INTERVAL 30 SECONDS
       STATE ON
FROM
customer (custid INT NOT NULL,
       name CHAR(100) NOT NULL,
       addr CHAR(100),
       zip INT,
       PRIMARY KEY(custid),
       PROPAGATE);

See PROPAGATE Cache Table Attribute in this book and CREATE CACHE GROUP in the Oracle TimesTen In-Memory Database SQL Reference.