Partager via


Transaction Retention

Committing or aborting the transaction with the fRetaining flag in ITransaction::Commit or ITransaction::Abort set to TRUE (also called a retaining commit or abort) causes a new transaction to be started immediately after the current one ends. If the fRetaining flag is set to FALSE, the transaction is committed or aborted and no new transaction is created. Any new work done on the session is outside the scope of a transaction. Attempting to explicitly commit or abort a transaction when there is no outstanding transaction returns an error.

A command object created within the scope of a transaction remains fully functional after the transaction is ended by a retaining commit or abort. The command also remains active in the case of a nonretaining commit or abort, but its prepared state may be lost.

Note

A retaining commit or abort should not change the characteristics (isolation level, isolation flags, transaction options) of the transaction. The new unit of work retains the same characteristics as the committed work.