Transaction Overview

All operations on a TimesTen database, even those that do not modify or access application data, run within a transaction.

When running an operation and there is no outstanding transaction, one is started automatically on behalf of the application. Transactions are completed by an explicit or implicit commit or rollback. When completed, resources (such as locks and result sets) that were acquired or opened by the transaction are released and freed.

When using SQL statements or supported APIs (such as ODBC and JDBC) to commit or rollback your transaction:

  • When you commit the current transaction, updates made in the transaction are made available to concurrent transactions.

  • When you rollback the current transaction, all updates made in the transaction are undone.

Read-only transactions hold minimal resources, so you do not need to commit every read operation. When running write operations, commit transactions to release locks. When possible, keep write transactions short in duration. Any long-running transactions can reduce concurrency and decrease throughput because locks are held for a longer period of time, which blocks concurrent transactions. Also, long-running transactions can prevent transaction log files from being purged, causing these files to accumulate on the file system.

A connection can have only one outstanding transaction at any time and cannot be explicitly closed if it has an open transaction.