Transaction Logging

The transaction log is used for multiple purposes.

  • Redo transactions if a system failure occurs

  • Undo transactions that are rolled back

  • Replicate changes to other TimesTen databases

  • When using cache, replicate changes to an Oracle database

  • For TimesTen Classic, enable applications to monitor changes to tables through the XLA interface

The transaction log is stored in files on the file system. The end of the transaction log resides in an in-memory buffer.

Note:

For more information about logging and checkpointing, see Transaction Management in the Oracle TimesTen In-Memory Database Operations Guide.

The following sections describe the processes of transaction logging:

Writing the Transaction Log Buffer to the File System

TimesTen writes the contents of the in-memory transaction log buffer to transaction log files on the file system at every durable commit, at every checkpoint, and at other times defined by the implementation.

Applications that cannot tolerate the loss of any committed transactions if a failure occurs should request a durable commit for every transaction that is not read-only by setting the appropriate durability connection attribute to 1.

Applications that can tolerate the loss of some recently committed transactions can significantly improve their performance by committing some or all of their transactions non-durably. To do so, set the appropriate durability connection attribute to 0 and request explicit durable commits either at regular time intervals or at specific points in their application logic.

For setting the correct durability connection attribute and how to request explicit durable commits for TimesTen Classic, see Durability Options in the Oracle TimesTen In-Memory Database Operations Guide. For setting the correct durability connection attribute and how to request explicit durable commits for TimesTen Scaleout, see Durability Settings in the Oracle TimesTen In-Memory Database Scaleout User's Guide.

When Are Transaction Log Files Deleted?

Transaction log files are kept until TimesTen declares them to be purgeable. When a transaction log file is purgeable, the next checkpoint operation deletes that transaction log file.

A transaction log file cannot be purged until all of the following actions have been completed:

  • All transactions writing log records to the transaction log file (or a previous transaction log file) have committed or rolled back.

  • All changes recorded in the transaction log file have been written to the checkpoint files.

  • When using TimesTen Classic replication, all changes recorded in the transaction log file have been replicated.

  • When using cache, all changes recorded in the transaction log file have been propagated to the Oracle database if cache has been configured for that behavior.

  • When XLA is used in TimesTen Classic, all changes recorded in transaction log files have been reported to the XLA applications.

See Checkpointing.

TimesTen Commits

ODBC provides an autocommit mode that forces a commit after each statement.

By default, autocommit is enabled so that an implicit commit is issued immediately after a statement runs successfully. TimesTen recommends that you turn autocommit off so that commits are intentional.

TimesTen issues an implicit commit before and after any data definition language (DDL) statement.