ttCachePropagateFlagSet

This procedure enables you to disable propagation of committed updates (the result of executing DML statements) within the current transaction to the Oracle database. Any updates from executing DML statements after the flag is set to zero are never propagated to the back-end Oracle database. Thus, these updates exist only on the TimesTen database. You can then re-enable propagation for DML statements by resetting the flag.

Required Privilege

This procedure requires the CACHE_MANAGER privilege.

Usage in TimesTen Scaleout and TimesTen Classic

This procedure is supported in TimesTen Classic but not supported in TimesTen Scaleout.

Related Views

This procedure has no related views.

Syntax

ttCachePropagateFlagSet(CommitsOn)

Parameters

ttCachePropagateFlagSet has the parameter:

Parameter Type Description

CommitsOn

TT_INTEGER NOT NULL

If 0, sets a flag to stop updates from being sent to the Oracle database. The flag remains set until the end of the transaction or until the procedure is set to 1.

If 1, updates are sent to the Oracle database.

Result Set

ttCachePropagateFlagSet returns no results.

Notes

  • This procedure is available only for cache operations.

  • If the value of ttCachePropagateFlagSet is reenabled several times during a single transaction, the transaction is only partially propagated to the Oracle database.

  • ttCachePropagateFlagSet is the only built-in procedure that applications can use in the same transaction as any of the other cache group operation, such as FLUSH, LOAD, REFRESH and UNLOAD.

  • The propagate flag is reset after a commit or rollback.

  • When using this procedure, it is important to turn off AutoCommit, otherwise after the procedure is called the transaction ends and propagation to the Oracle database is turned back on.

Examples

This example sets autocommit off to prevent the propagation flag from toggling from off to on after a commit. Calls the ttCachePropagateFlagSet to turn off propagation. A row is inserted into the TimesTen detail table for oratt.writetab. Then, propagation is reenabled by calling the ttCachePropagateFlagSet built-in procedure and setting the flag to one.

Command> set autocommit off;
         call ttCachePropagateFlagSet(0);
         INSERT INTO oratt.writetab VALUES (103, 'Agent');
1 row inserted.
Command> COMMIT;
Command> SELECT * FROM oratt.writetab;
< 100, Oracle >
< 101, TimesTen >
< 102, Cache >
< 103, Agent >
4 rows found.
Command> call ttCachePropagateFlagSet(1);

When you select all rows on the Oracle database, the row inserted when propagation was turned off is not present in the oratt.writetab table on Oracle.

Command> set passthrough 3;
         SELECT * FROM oratt.writetab;
< 100, Oracle >
< 101, TimesTen >
< 102, Cache >
3 rows found.