Documentation Home
MySQL NDB Cluster API Developer Guide
Download this Manual NdbBlob::close()

Description.  Closes the blob handle, releasing internal resources as it does so, prior to committing or aborting the transaction. In other words, this signals that an application has finished with reading from a given blob. This method can be called only when the blob's State is Active.

Read operations and locking.  When a blob handle is created on a read operation using LM_Read or LM_Exclusive as the LockMode, the read operation can be unlocked only once all Blob handles created on this operation have been closed.

When a row containing blobs has been read with lock mode LM_CommittedRead, the mode is automatically upgraded to LM_Read to ensure consistency. In this case, when all the blob handles for the row have been closed, an unlock operation for the row is automatically performed by the call to the close() method, which adds a pending write operation to the blob. The upgraded lock is released following the call to execute().


int close
      bool execPendingBlobOps = true

Parameters.  This method has a single boolean parameter execPendingBlobOps. If the value of this parameter true (the default), any pending blob operations are flushed before the blob handle is closed. If execPendingBlobOps is false, then it is assumed that the blob handle has no pending read or write operations to flush.

Return value.  0 on success.