Nested Transactions

It is possible to place a transaction group in another transaction group, thus "nesting" transactions. However, each group starts a separate transaction and behaves independent of the nesting group. The following table describes the effect of creating a transaction group in another transaction group.

Effects of nesting transaction groups

Transaction type

JDBC

XA

JTA

JMS Local

JDBC

Nesting JDBC transactions in other JDBC transactions is allowed, but each transaction is independent. That is, each transaction commits or rolls back separately. The outcome of the parent transaction does not affect the nested transaction.

Nesting JDBC transactions in an XA transaction is allowed, but each transaction is independent.

Nesting JDBC transactions in a JTA transaction is allowed, but each transaction is independent.

Nesting JDBC transactions in a JMS Local transaction is allowed, but each transaction is independent.

 

XA

Nesting XA transactions in JDBC transactions is allowed, but each transaction commits or rolls back separately.

Nesting XA transactions in XA transactions is allowed, but each transaction commits or rolls back separately.

Nesting XA transactions in JTA transactions is allowed, but each transaction commits or rolls back separately.

Nesting XA transactions in JMS Local transactions is allowed, but each transaction commits or rolls back separately.

JTA

Nesting JTA transactions in JDBC transactions is allowed, but each transaction is independent.

Nesting JTA transactions in XA transactions is allowed, but each transaction is independent.

Nesting JTA transactions in JTA transactions is not allowed. An exception is thrown at the start of the nested transaction.

Nesting JTA transactions in JMS Local transactions is allowed, but each transaction is independent.

 

JMS Local

Nesting JMS Local transactions in JDBC transactions is allowed, but each transaction is independent.

Nesting JMS Local transactions in XA transactions is allowed, but each transaction is independent.

Nesting JMS Local transactions in JTA transactions is allowed, but each transaction is independent.

Nesting JMS Local transactions in other JMS Local transactions is allowed, but each transaction is independent. That is, each transaction commits or rolls back separately. The outcome of the parent transaction does not affect the nested transaction.