6 Understanding Distributed Transactions in TimesTen Scaleout

In TimesTen Scaleout, distributed transactions are processed by a two-phase commit protocol. This chapter discusses how TimesTen Scaleout maintains ACID-compliant databases through distributed transactions.

The following terminology is related to understanding the distributed transaction processing algorithms that TimesTen Scaleout employs:

  • Participant: An element that runs one or more SQL statements from a distributed transaction. Not all elements in a database participate in every transaction. An element only becomes a participant of a transaction if one or more operations of that transaction requires access to the data stored in the element.

    Note:

    Each element maintains its own independent set of checkpoint and transaction log files. They behave in the same manner as the checkpoint and transaction log files of a database in TimesTen Classic. See Checkpoint Operations and Transaction Logging in Oracle TimesTen In-Memory Database Operations Guide.

  • Transaction manager: The thread of the application (or of the TimesTen server, for a client/server application) that is connected to the database and initiates the transaction. The transaction manager coordinates the transaction operations with all participants.

  • Prepare-to-commit log record: A type of log record written to the transaction log of the database during the prepare phase of the two-phase commit protocol. It contains the commit decision for the transaction.

  • Durable log record: Participants write a prepare-to-commit or commit log record synchronously to the transaction log. Nondurable log records are asynchronously written by the participants.

  • Distributed transaction: A transaction with two or more participants.

  • Single-element transaction: A transaction with only one participant. Single-element transactions do not use the two-phase commit protocol. Single-element transactions are only possible in a grid with K-safety set to 1.

  • In-doubt transaction: A transaction where a participant wrote a prepare-to-commit log record, but the commit log record is not present in the transaction log. If the transaction manager wrote the prepare-to-commit log record to the transaction log, which means there is a known commit decision, then the transaction is not in-doubt.

  • Remote connection: A connection from the transaction manager to a participant of the transaction.

This chapter includes the following topics: