Synchronous transactions are defined and executed as follows:
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.
Define operations and add them to the transaction, using one or more of the following:
NdbTransaction::getNdbOperation()
NdbTransaction::getNdbScanOperation()
NdbTransaction::getNdbIndexOperation()
NdbTransaction::getNdbIndexScanOperation()
along with the appropriate methods of the
respectiveNdbOperation
class (or
possibly one or more of its subclasses). Note that, at
this point, the transaction has still not yet been sent to
the NDB kernel.
Execute the transaction, using the
NdbTransaction::execute()
method.
Close the transaction by calling
Ndb::closeTransaction()
.
For an example of this process, see Section 2.4.1, “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.