Using Transactions

The procedure for using transactions is as follows:

  1. Start a transaction (instantiate an NdbTransaction object).

  2. Add and define operations associated with the transaction using instances of one or more of the NdbOperation, NdbScanOperation, NdbIndexOperation, and NdbIndexScanOperation classes.

  3. Execute the transaction (call NdbTransaction::execute()).

  4. The operation can be of two different types—Commit or NoCommit:

    • If the operation is of type NoCommit, then the application program requests that the operation portion of a transaction be executed, but without actually committing the transaction. Following the execution of a NoCommit operation, the program can continue to define additional transaction operations for later execution.

      NoCommit operations can also be rolled back by the application.

    • If the operation is of type Commit, then the transaction is immediately committed. The transaction must be closed after it has been committed (even if the commit fails), and no further operations can be added to or defined for this transaction.

    See Section, “The NdbTransaction::ExecType Type”.

Download this Manual
PDF (US Ltr) - 4.8Mb
PDF (A4) - 4.8Mb
EPUB - 1.9Mb
HTML Download (TGZ) - 1.8Mb
HTML Download (Zip) - 1.9Mb
User Comments
Sign Up Login You must be logged in to post a comment.