Transmitting Data Between TimesTen and an Oracle Database

TimesTen maintains consistency between cached data and the Oracle database by automatically propagating updates from cache groups to the Oracle database and automatically refreshing data in cache groups from the Oracle database.

The rest of this section includes the following topics:

Updating a Cache Group From the Oracle Database Tables

Manual refresh and autorefresh operations are used to keep a cache group synchronized with the corresponding data in the Oracle database tables.

  • Autorefresh - An incremental autorefresh operation updates only records that have been modified in the Oracle database since the last refresh. Cache operations automatically perform the incremental refresh at specified time intervals. You can also specify a full autorefresh operation, which automatically refreshes the entire cache group at specified time intervals.

    TimesTen Scaleout only supports the incremental autorefresh option of these two options.

  • Manual refresh - An application issues a REFRESH CACHE GROUP statement to refresh either an entire cache group or a specific cache instance. It is equivalent to unloading and then loading the cache group or cache instance.

These mechanisms are useful under different circumstances. A full autorefresh may be the best choice if the Oracle database table is updated only once a day and many rows are changed. An incremental autorefresh is the best choice if the Oracle database table is updated often, but only a few rows are changed with each update. A manual refresh is the best choice if the application logic knows when the refresh should happen.

See Methods for Transmitting Changes Between TimesTen and Oracle Databases in the Oracle TimesTen In-Memory Database Cache Guide.

Updating the Oracle Database Tables From a Cache Group

The propagate and flush mechanisms are available to keep the Oracle database up to date with the cache group.

  • Propagate - The most common way to propagate cache group data to the Oracle database is by using an asynchronous writethrough (AWT) cache group. Other methods of updating the Oracle database tables are using a synchronous writethrough (SWT) cache group or specifying the PROPAGATE option in a user managed cache group.

    Changes to an AWT cache group are committed without waiting for the changes to be applied to the Oracle database tables. AWT cache groups provide better response times and performance than SWT cache groups and user managed cache groups with the PROPAGATE option, but the TimesTen database and the Oracle database do not always contain the same data because changes are applied to the Oracle database tables asynchronously.

    You can increase throughput from AWT cache groups to the Oracle database tables by configuring parallel replication at database creation time. You configure the number of threads for applying updates to the Oracle database tables.

  • Flush - A flush operation can be used to propagate updates manually from a user managed cache group to the Oracle database. An application initiates a flush operation by issuing a FLUSH CACHE GROUP statement. Flush operations are useful when frequent updates occur for a limited period of time over a set of records. Flush operations do not propagate deletes.

For more information about autorefresh or manual refresh operations for cache groups, see Methods for Transmitting Changes Between TimesTen and Oracle databases in the Oracle TimesTen In-Memory Database Cache Guide.