Asynchronous WriteThrough (AWT) Cache Group

An Asynchronous WriteThrough (AWT) cache group enforces a caching behavior where committed changes on the TimesTen cache tables are automatically and asynchronously propagated to the cached Oracle Database tables.

See Figure 4-6.

Only TimesTen Classic supports AWT cache groups.

Note:

You should avoid running DML statements on Oracle Database tables cached in an AWT cache group. This can result in an error condition. See Restrictions with AWT Cache Groups.

The transaction commit on a TimesTen database occurs asynchronously from the commit on an Oracle database. This enables an application to continue issuing transactions on a TimesTen database without waiting for the Oracle Database transaction to complete. However, your application cannot ensure when the transactions are completed on an Oracle database.

You can update cache tables in an AWT cache group even if the Oracle database is unavailable. When the Oracle database returns to operation, updates that were committed on the cache tables while the Oracle database was unavailable are automatically propagated to the cached Oracle Database tables.

Note:

When TimesTen manages operations for AWT cache groups, it connects to the Oracle database using the Oracle cache administration user name and password set with the ttCacheUidPwdSet built-in procedure. For more details on ttCacheUidPwdSet, see Registering the Cache Administration User Name and Password.

Since an AWT cache group propagates data from the TimesTen database to the Oracle database, any data modified by the user in the cached tables on the Oracle database is not automatically uploaded from the Oracle database to the TimesTen database. In this case, you must manually run a REFRESH CACHE GROUP SQL statement to have any changes done to the Oracle database transmitted to the TimesTen database.

Processing of any REFRESH CACHE GROUP or UNLOAD CACHE GROUP statement for an AWT cache group waits until updates on any of the rows modified on the TimesTen database have been propagated to the Oracle database.

On the Oracle Database:

The following is an example of a definition of the Oracle database table that is to be cached in an AWT cache group. The Oracle database table is owned by the schema user sales.

CREATE TABLE customer
(cust_num NUMBER(6) NOT NULL PRIMARY KEY,
 region   VARCHAR2(10),
 name     VARCHAR2(50),
 address  VARCHAR2(100));

When the cached tables are a part of an AWT cache group, then the Oracle cache administration user must be granted the SELECT, INSERT, UPDATE, and DELETE privileges on any cached tables. In this example, the table is the sales.customer table.

See Required Privileges for Cache Administration User for Cache Operations for all required privileges for different activities.

On the Oracle database as an administrator, grant the following privileges:

SQL> GRANT SELECT, INSERT, UPDATE, DELETE ON sales.customer TO cacheadmin;

On the TimesTen database:

Connect as the TimesTen cache administraiton user. Use the CREATE ASYNCHRONOUS WRITETHROUGH CACHE GROUP statement to create an AWT cache group.

The following statement creates an AWT cache group new_customers that caches the sales.customer table:

CREATE ASYNCHRONOUS WRITETHROUGH CACHE GROUP new_customers
FROM sales.customer
 (cust_num NUMBER(6) NOT NULL,
  region   VARCHAR2(10),
  name     VARCHAR2(50),
  address  VARCHAR2(100),
  PRIMARY KEY(cust_num));

The following sections describe configuration, behavior, and management for AWT cache groups: