DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

Nested Transactions

A nested transaction is used to provide a transactional guarantee for a subset of operations performed within the scope of a larger transaction. Doing this allows you to commit and abort the subset of operations independently of the larger transaction.

The rules to the usage of a nested transaction are as follows:

To create a nested transaction, simply pass the parent transaction's handle when you created the nested transaction's handle. For example:

    /* parent transaction */
    DB_TXN *parent_txn, *child_txn;
    ret = envp->txn_begin(envp, NULL, &parent_txn, 0);
    /* child transaction */
    ret = envp->txn_begin(envp, parent_txn, &child_txn, 0);