Synchronous Transactions

Synchronous transactions are defined and executed as follows:

  1. Begin (create) the transaction, which is referenced by an NdbTransaction object typically created using Ndb::startTransaction(). At this point, the transaction is merely being defined; it is not yet sent to the NDB kernel.

  2. Define operations and add them to the transaction, using one or more of the following, along with the appropriate methods of the respectiveNdbOperation class (or possibly one or more of its subclasses):

    At this point, the transaction has still not yet been sent to the NDB kernel.

  3. Execute the transaction, using the NdbTransaction::execute() method.

  4. Close the transaction by calling Ndb::closeTransaction().

For an example of this process, see Section 2.5.2, “NDB API Example Using Synchronous Transactions”.

To execute several synchronous transactions in parallel, you can either use multiple Ndb objects in several threads, or start multiple application programs.