MySQL NDB Cluster API Developer Guide
A transaction is always either automatic or explicit. If it is automatic, (autocommit), every operation is performed as part of a new transaction that is automatically committed.
begin();
Begin a transaction. No arguments are required. If a transaction is already active, an exception is thrown.
commit(Function(Objecterror)callback);
Commit a transaction.
This method takes as its sole argument a
callback function that returns an
error object.
rollback(Function(Objecterror)callback);
Roll back a transaction. Errors are reported in the
callback function.
Boolean isActive();
Determine whether or not a given transaction is currently active. Returns true if a transaction is active, and false otherwise.
isActive() requires no arguments.
setRollbackOnly();
Mark the transaction as rollback-only. Once this is done,
commit() rolls back the transaction and
throws an exception; rollback() rolls the
transaction back, but does not throw an exception. To mark a
transaction as rollback-only, call the
setRollbackOnly() method, as shown here.
This method is one-way; a transaction marked as rollback-only
cannot be unmarked. Invoking
setRollbackOnly() while in autocommit mode
throws an exception. This method requires no arguments.
boolean getRollbackOnly();
Determine whether a transaction has been marked as
rollback-only. Returns true if the transaction has been so
marked. setRollbackOnly() takes no arguments.