This class represents the
NDB kernel; it is the
primary class of the NDB API.
Parent class. None
Child classes. None
Any nontrivial NDB API program makes use of at least one instance
Ndb. By using several
objects, it is possible to implement a multi-threaded application.
You should remember that one
Ndb object cannot
be shared between threads; however, it is possible for a single
thread to use multiple
Ndb objects. A single
application process can support a maximum of 4711
Resource consumption by
Ndb object consumes memory in proportion to
the size of the largest operation performed over the lifetime of
the object. This is particularly noticeable in cases of large
transactions; use of one or both of
TEXT columns; or both. This memory
is held for the lifetime of the object, and once used in this way
Ndb object, the only way to free this
memory is to destroy the object (and then to create a new instance
Ndb object is multi-thread safe in that
Ndb object can be handled by one thread at
a time. If an
Ndb object is handed over to
another thread, then the application must ensure that a memory
barrier is used to ensure that the new thread sees all updates
performed by the previous thread.
Semaphores and mutexes are examples of easy ways to provide memory barriers without having to bother about the memory barrier concept.
It is also possible to use multiple
to perform operations on different clusters in a single application.
See Application-level partitioning, for
conditions and restrictions applying to such usage.
Methods. The following table lists the public methods of this class and the purpose or use of each method:
|Method||Purpose / Use|
||Class constructor; represents a connection to a MySQL Cluster.|
||Class destructor; terminates a Cluster connection when it is no longer to be used|
||Closes a transaction.|
||Computes a distribution hash value.|
||Creates a subscription to a database event. (See Section 2.3.20, “The NdbEventOperation Class”.)|
||Drops a subscription to a database event.|
||Gets a dictionary, which is used for working with database schema information.|
||Gets the name of the current database.|
||Gets the name of the current database schema.|
||Gets the next event operation from a GCI.|
||Retrieves an error. (See Section 2.3.19, “The
||Retrieves extra error details. Added in MySQL Cluster NDB 6.2.19, MySQL Cluster NDB 6.3.29, and MySQL Cluster NDB 7.0.10.|
||Retrieves a reference or identifier for the
||Returns the next event operation.|
||Waits for an event to occur.|
||Sets the name of the current database.|
||Sets the name of the current database schema.|
||Set an arbitrary name for the
||Begins a transaction. (See Section 2.3.29, “The NdbTransaction Class”.)|
For detailed descriptions, signatures, and examples of use for each of these methods, see Section 184.108.40.206, “Ndb Methods”.
This diagram shows all the available members of the