The procedure for using transactions is as follows:
Start a transaction (instantiate an
NdbTransactionobject).Add and define operations associated with the transaction using instances of one or more of the
NdbOperation,NdbScanOperation,NdbIndexOperation, andNdbIndexScanOperationclasses.Execute the transaction (call
NdbTransaction::execute()).-
The operation can be of two different types—
CommitorNoCommit:-
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 aNoCommitoperation, the program can continue to define additional transaction operations for later execution.NoCommitoperations 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.
-