JBoss.orgCommunity Documentation

Chapter 6. Transaction Support

6.1. AutoWrap Execution Property
6.2. Updating Model Count
6.3. JDBC and Transactions
6.3.1. JDBC API Functionality
6.3.2. J2EE Usage Models
6.4. Limitations and Workarounds

Teiid utilizes XA transactions for both participating in global transactions and for demarcating its own local and command scoped transactions. JBoss Transactions is used by Teiid as its internal transaction manager. See this documentation for the advanced features provided by JBoss Transactions.

Table 6.1. Teiid Transaction Scopes

Command Treats the user command as if all source commands are executed within the scope of the same transaction. The AutoWrap execution property controls the behavior of command level transactions.
LocalThe transaction boundary is local defined by a single client session.
GlobalTeiid participates in a global transaction as an XA Resource.

Since user level commands may execute multiple source commands, users can specify the AutoWrap execution property to control the transactional behavior of a user command when not in a local or global transaction.

The concept of command safety with respect to a transaction is determined by Teiid based upon command type and available metadata. Whenever any INSERT, UPDATE, DELETE, or EXECUTE (with update count greater than 0) command is detected and the success or failure of that command is not the same as the user level command, then the command is deemed unsafe without a transaction.

The update count may be set on dynamic SQL as part of the command and on all other procedures as part of the procedure metadata in the model.

The term "updating model count" refers to the number of times any model is updated during the execution of a command. It is used to determine whether a transaction, of any scope, is required to safely execute the command.

By default Teiid will calculate the updating model count for a user query (which may be composed of many subcommands) given the above table. Thus a command with a single update as a subcommand may still require a transaction if the update is not tied to the success of the command.

Explicit values for updating model count may be set using Teiid Designer and directly in the dynamic SQL command .