NdbTransaction Class Reference

Represents a transaction. More...

#include <NdbTransaction.hpp>

List of all members.

Public Types

enum  ExecType { NoCommit, Commit, Rollback }

Public Member Functions

NdbOperationgetNdbOperation (const char *aTableName)
NdbOperationgetNdbOperation (const NdbDictionary::Table *aTable)
NdbScanOperationgetNdbScanOperation (const char *aTableName)
NdbScanOperationgetNdbScanOperation (const NdbDictionary::Table *aTable)
NdbIndexScanOperationgetNdbIndexScanOperation (const char *anIndexName, const char *aTableName)
NdbIndexScanOperationgetNdbIndexScanOperation (const NdbDictionary::Index *anIndex, const NdbDictionary::Table *aTable)
NdbIndexScanOperationgetNdbIndexScanOperation (const NdbDictionary::Index *anIndex)
NdbIndexOperationgetNdbIndexOperation (const char *anIndexName, const char *aTableName)
NdbIndexOperationgetNdbIndexOperation (const NdbDictionary::Index *anIndex, const NdbDictionary::Table *aTable)
NdbIndexOperationgetNdbIndexOperation (const NdbDictionary::Index *anIndex)
Execute Transaction
int execute (ExecType execType, NdbOperation::AbortOption=NdbOperation::DefaultAbortOption, int force=0)
int execute (::ExecType execType,::AbortOption abortOption=::DefaultAbortOption, int force=0)
int refresh ()
void close ()

Meta Information

enum  CommitStatusType {
  NotStarted, Started, Committed, Aborted,
  NeedAbort
}
int getGCI (Uint64 *gciptr)
int getGCI ()
Uint64 getTransactionId ()
CommitStatusType commitStatus ()

Error Handling

enum  ConStatusType {
  NotConnected, Connecting, Connected, DisConnecting,
  ConnectFailure
}
enum  SendStatusType {
  NotInit, InitState, sendOperations, sendCompleted,
  sendCOMMITstate, sendABORT, sendABORTfail, sendTC_ROLLBACK,
  sendTC_COMMIT, sendTC_OP
}
enum  CompletionStatus { NotCompleted, CompletedSuccess, CompletedFailure, DefinitionFailure }
enum  ReturnType { ReturnSuccess, ReturnFailure }
enum  ListState { NotInList, InPreparedList, InSendList, InCompletedList }
typedef Uint64 TimeMillis_t
Uint32 theId
SendStatusType theSendStatus
NdbAsynchCallback theCallbackFunction
void * theCallbackObject
Uint32 theTransArrayIndex
TimeMillis_t theStartTransTime
NdbError theError
int theErrorLine
NdbOperationtheErrorOperation
NdbtheNdb
NdbTransactiontheNext
NdbOperationtheFirstOpInList
NdbOperationtheLastOpInList
NdbOperationtheFirstExecOpInList
NdbOperationtheLastExecOpInList
NdbOperationtheCompletedFirstOp
NdbOperationtheCompletedLastOp
Uint32 theNoOfOpSent
Uint32 theNoOfOpCompleted
Uint32 theMyRef
Uint32 theTCConPtr
Uint64 theTransactionId
Uint64 theGlobalCheckpointId
Uint64 * p_latest_trans_gci
ConStatusType theStatus
enum
NdbTransaction::CompletionStatus 
theCompletionStatus
CommitStatusType theCommitStatus
Uint32 theMagicNumber
Uint32 thePriority
ReturnType theReturnStatus
bool theTransactionIsStarted
bool theInUseState
bool theSimpleState
enum NdbTransaction::ListState theListState
Uint32 theDBnode
Uint32 theNodeSequence
bool theReleaseOnClose
Uint32 m_db_nodes [2]
Uint32 m_failed_db_nodes [2]
bool m_waitForReply
NdbIndexScanOperationm_theFirstScanOperation
NdbIndexScanOperationm_theLastScanOperation
NdbIndexScanOperationm_firstExecutedScanOp
NdbScanOperationtheScanningOp
Uint32 theBuddyConPtr
bool theBlobFlag
Uint8 thePendingBlobOps
class HugoOperations
struct Ndb_free_list_t< NdbTransaction >
const NdbErrorgetNdbError () const
NdbOperationgetNdbErrorOperation ()
const NdbOperationgetNdbErrorOperation () const
int getNdbErrorLine ()
const NdbOperationgetNextCompletedOperation (const NdbOperation *op) const
const NdbOperationreadTuple (const NdbRecord *key_rec, const char *key_row, const NdbRecord *result_rec, char *result_row, NdbOperation::LockMode lock_mode=NdbOperation::LM_Read, const unsigned char *result_mask=0, const NdbOperation::OperationOptions *opts=0, Uint32 sizeOfOptions=0)
const NdbOperationinsertTuple (const NdbRecord *key_rec, const char *key_row, const NdbRecord *attr_rec, const char *attr_row, const unsigned char *mask=0, const NdbOperation::OperationOptions *opts=0, Uint32 sizeOfOptions=0)
const NdbOperationinsertTuple (const NdbRecord *combined_rec, const char *combined_row, const unsigned char *mask=0, const NdbOperation::OperationOptions *opts=0, Uint32 sizeOfOptions=0)
const NdbOperationupdateTuple (const NdbRecord *key_rec, const char *key_row, const NdbRecord *attr_rec, const char *attr_row, const unsigned char *mask=0, const NdbOperation::OperationOptions *opts=0, Uint32 sizeOfOptions=0)
const NdbOperationwriteTuple (const NdbRecord *key_rec, const char *key_row, const NdbRecord *attr_rec, const char *attr_row, const unsigned char *mask=0, const NdbOperation::OperationOptions *opts=0, Uint32 sizeOfOptions=0)
const NdbOperationdeleteTuple (const NdbRecord *key_rec, const char *key_row, const NdbRecord *result_rec, char *result_row=0, const unsigned char *result_mask=0, const NdbOperation::OperationOptions *opts=0, Uint32 sizeOfOptions=0)
NdbScanOperationscanTable (const NdbRecord *result_record, NdbOperation::LockMode lock_mode=NdbOperation::LM_Read, const unsigned char *result_mask=0, const NdbScanOperation::ScanOptions *options=0, Uint32 sizeOfOptions=0)
NdbIndexScanOperationscanIndex (const NdbRecord *key_record, const NdbRecord *result_record, NdbOperation::LockMode lock_mode=NdbOperation::LM_Read, const unsigned char *result_mask=0, const NdbIndexScanOperation::IndexBound *bound=0, const NdbScanOperation::ScanOptions *options=0, Uint32 sizeOfOptions=0)
void releaseCompletedOperations ()
 NdbTransaction (Ndb *aNdb)
 ~NdbTransaction ()
int init ()
int executeNoBlobs (ExecType execType, NdbOperation::AbortOption=NdbOperation::DefaultAbortOption, int force=0)
void setConnectedNodeId (Uint32 nodeId, Uint32 sequence)
void setMyBlockReference (int)
void setTC_ConnectPtr (Uint32)
int getTC_ConnectPtr ()
void setBuddyConPtr (Uint32)
Uint32 getBuddyConPtr ()
NdbTransactionnext ()
void next (NdbTransaction *)
ConStatusType Status ()
void Status (ConStatusType)
Uint32 get_send_size ()
void set_send_size (Uint32)
int receiveDIHNDBTAMPER (NdbApiSignal *anApiSignal)
int receiveTCSEIZECONF (NdbApiSignal *anApiSignal)
int receiveTCSEIZEREF (NdbApiSignal *anApiSignal)
int receiveTCRELEASECONF (NdbApiSignal *anApiSignal)
int receiveTCRELEASEREF (NdbApiSignal *anApiSignal)
int receiveTC_COMMITCONF (const class TcCommitConf *, Uint32 len)
int receiveTCKEYCONF (const class TcKeyConf *, Uint32 aDataLength)
int receiveTCKEY_FAILCONF (const class TcKeyFailConf *)
int receiveTCKEY_FAILREF (NdbApiSignal *anApiSignal)
int receiveTC_COMMITREF (NdbApiSignal *anApiSignal)
int receiveTCROLLBACKCONF (NdbApiSignal *anApiSignal)
int receiveTCROLLBACKREF (NdbApiSignal *anApiSignal)
int receiveTCROLLBACKREP (NdbApiSignal *anApiSignal)
int receiveTCINDXCONF (const class TcIndxConf *, Uint32 aDataLength)
int receiveTCINDXREF (NdbApiSignal *)
int receiveSCAN_TABREF (NdbApiSignal *)
int receiveSCAN_TABCONF (NdbApiSignal *, const Uint32 *, Uint32 len)
int doSend ()
int sendROLLBACK ()
int sendTC_HBREP ()
int sendCOMMIT ()
void setGCI (int GCI)
int OpCompleteFailure (NdbOperation *)
int OpCompleteSuccess ()
void CompletedOperations ()
void OpSent ()
void release ()
void releaseOperations ()
void releaseOps (NdbOperation *)
void releaseScanOperations (NdbIndexScanOperation *)
bool releaseScanOperation (NdbIndexScanOperation **listhead, NdbIndexScanOperation **listtail, NdbIndexScanOperation *op)
void releaseExecutedScanOperation (NdbIndexScanOperation *)
void setTransactionId (Uint64 aTransactionId)
void setErrorCode (int anErrorCode)
void setOperationErrorCode (int anErrorCode)
void setOperationErrorCodeAbort (int anErrorCode, int abortOption=-1)
int checkMagicNumber ()
NdbOperationgetNdbOperation (const class NdbTableImpl *aTable, NdbOperation *aNextOp=0, bool useRec=false)
NdbIndexScanOperationgetNdbScanOperation (const class NdbTableImpl *aTable)
NdbIndexOperationgetNdbIndexOperation (const class NdbIndexImpl *anIndex, const class NdbTableImpl *aTable, NdbOperation *aNextOp=0, bool useRec=false)
NdbIndexScanOperationgetNdbIndexScanOperation (const NdbIndexImpl *index, const NdbTableImpl *table)
NdbOperationsetupRecordOp (NdbOperation::OperationType type, NdbOperation::LockMode lock_mode, NdbOperation::AbortOption default_ao, const NdbRecord *key_record, const char *key_row, const NdbRecord *attribute_record, const char *attribute_row, const unsigned char *mask, const NdbOperation::OperationOptions *opts, Uint32 sizeOfOptions)
void handleExecuteCompletion ()
Uint32 ptr2int ()
int report_node_failure (Uint32 id)
bool hasBlobOperation ()
void completedFail (const char *s)
bool checkState_TransId (const Uint32 *transId) const
void remove_list (NdbOperation *&head, NdbOperation *)
void define_scan_op (NdbIndexScanOperation *)
 NdbTransaction (const NdbTransaction &)
NdbTransactionoperator= (const NdbTransaction &)
static void sendTC_COMMIT_ACK (class TransporterFacade *, NdbApiSignal *, Uint32 transId1, Uint32 transId2, Uint32 aBlockRef)


Detailed Description

Represents a transaction.

A transaction (represented by an NdbTransaction object) belongs to an Ndb object and is created using Ndb::startTransaction(). A transaction consists of a list of operations (represented by NdbOperation, NdbScanOperation, NdbIndexOperation, and NdbIndexScanOperation objects). Each operation access exactly one table.

After getting the NdbTransaction object, the first step is to get (allocate) an operation given the table name using one of the methods getNdbOperation(), getNdbScanOperation(), getNdbIndexOperation(), or getNdbIndexScanOperation(). Then the operation is defined. Several operations can be defined on the same NdbTransaction object, they will in that case be executed in parallell. When all operations are defined, the execute() method sends them to the NDB kernel for execution.

The execute() method returns when the NDB kernel has completed execution of all operations defined before the call to execute(). All allocated operations should be properly defined before calling execute().

A call to execute() uses one out of three types of execution:

  1. NdbTransaction::NoCommit Executes operations without committing them.
  2. NdbTransaction::Commit Executes remaining operation and commits the complete transaction
  3. NdbTransaction::Rollback Rollbacks the entire transaction.

execute() is equipped with an extra error handling parameter. There are two alternatives:

  1. NdbTransaction::AbortOnError (default). The transaction is aborted if there are any error during the execution
  2. NdbTransaction::AO_IgnoreError Continue execution of transaction even if operation fails

Member Typedef Documentation

typedef Uint64 NdbTransaction::TimeMillis_t [private]


Member Enumeration Documentation

The commit status of the transaction.

Enumerator:
NotStarted  Transaction not yet started.
Started  Missing explanation
Committed  Transaction has been committed.
Aborted  Transaction has been aborted.
NeedAbort  Missing explanation

Enumerator:
NotCompleted 
CompletedSuccess 
CompletedFailure 
DefinitionFailure 

Enumerator:
NotConnected 
Connecting 
Connected 
DisConnecting 
ConnectFailure 

Execution type of transaction

Enumerator:
NoCommit  Execute the transaction as far as it has been defined, but do not yet commit it
Commit  Execute and try to commit the transaction.
Rollback  Rollback transaction.

enum NdbTransaction::ListState [private]

Enumerator:
NotInList 
InPreparedList 
InSendList 
InCompletedList 

Enumerator:
ReturnSuccess 
ReturnFailure 

Enumerator:
NotInit 
InitState 
sendOperations 
sendCompleted 
sendCOMMITstate 
sendABORT 
sendABORTfail 
sendTC_ROLLBACK 
sendTC_COMMIT 
sendTC_OP 


Constructor & Destructor Documentation

NdbTransaction::NdbTransaction ( Ndb aNdb  )  [private]

NdbTransaction::~NdbTransaction (  )  [private]

NdbTransaction::NdbTransaction ( const NdbTransaction  )  [private]


Member Function Documentation

int NdbTransaction::checkMagicNumber (  )  [private]

bool NdbTransaction::checkState_TransId ( const Uint32 *  transId  )  const [private]

void NdbTransaction::close (  ) 

Close transaction

Note:
Equivalent to to calling Ndb::closeTransaction()

CommitStatusType NdbTransaction::commitStatus (  ) 

Get the commit status of the transaction.

Returns:
The commit status of the transaction

void NdbTransaction::completedFail ( const char *  s  )  [private]

void NdbTransaction::CompletedOperations (  )  [private]

void NdbTransaction::define_scan_op ( NdbIndexScanOperation  )  [private]

const NdbOperation* NdbTransaction::deleteTuple ( const NdbRecord *  key_rec,
const char *  key_row,
const NdbRecord *  result_rec,
char *  result_row = 0,
const unsigned char *  result_mask = 0,
const NdbOperation::OperationOptions opts = 0,
Uint32  sizeOfOptions = 0 
)

int NdbTransaction::doSend (  )  [private]

int NdbTransaction::execute ( ::ExecType  execType,
::AbortOption  abortOption = ::DefaultAbortOption,
int  force = 0 
) [inline]

int NdbTransaction::execute ( ExecType  execType,
NdbOperation::AbortOption  = NdbOperation::DefaultAbortOption,
int  force = 0 
)

Executes transaction.

Parameters:
execType Execution type:
ExecType::NoCommit executes operations without committing them.
ExecType::Commit executes remaining operations and commits the complete transaction.
ExecType::Rollback rollbacks the entire transaction.
abortOption Handling of error while excuting AbortOnError - Abort transaction if an operation fail AO_IgnoreError - Accept failing operations DefaultAbortOption - Use per-operation abort option
force When operations should be sent to NDB Kernel. (See Adaptive Send Algorithm.)
  • 0: non-force, adaptive algorithm notices it (default);
  • 1: force send, adaptive algorithm notices it;
  • 2: non-force, adaptive algorithm do not notice the send.
Returns:
0 if successful otherwise -1.

int NdbTransaction::executeNoBlobs ( ExecType  execType,
NdbOperation::AbortOption  = NdbOperation::DefaultAbortOption,
int  force = 0 
) [private]

Uint32 NdbTransaction::get_send_size (  )  [private]

Uint32 NdbTransaction::getBuddyConPtr (  )  [private]

int NdbTransaction::getGCI (  ) 

Deprecated...in favor of getGCI(Uint64*)

int NdbTransaction::getGCI ( Uint64 *  gciptr  ) 

Get global checkpoint identity (GCI) of transaction.

Each committed transaction belong to a GCI. The log for the committed transaction is saved on disk when a global checkpoint occurs.

Whether or not the global checkpoint with this GCI has been saved on disk or not cannot be determined by this method.

By comparing the GCI of a transaction with the value last GCI restored in a restarted NDB Cluster one can determine whether the transaction was restored or not.

Note:
Global Checkpoint Identity is undefined for scan transactions (This is because no updates are performed in scan transactions.)
Returns:
0 if GCI is available, and stored in gciptr -1 if GCI is not available. (Note that there has to be an NdbTransaction::execute call with Ndb::Commit for the GCI to be available.)

const NdbError& NdbTransaction::getNdbError (  )  const

Get error object with information about the latest error.

Returns:
An error object with information about the latest error.

int NdbTransaction::getNdbErrorLine (  ) 

Get the method number where the latest error occured.

Returns:
Line number where latest error occured.

const NdbOperation* NdbTransaction::getNdbErrorOperation (  )  const

Get the latest NdbOperation which had an error. This method is used on the NdbTransaction object to find the NdbOperation causing an error. To find more information about the actual error, use method NdbOperation::getNdbError() on the returned NdbOperation object.

Returns:
The NdbOperation causing the latest error.

NdbOperation* NdbTransaction::getNdbErrorOperation (  ) 

Get the latest NdbOperation which had an error. This method is used on the NdbTransaction object to find the NdbOperation causing an error. To find more information about the actual error, use method NdbOperation::getNdbError() on the returned NdbOperation object.

Returns:
The NdbOperation causing the latest error.
Deprecated:
Use the const NdbOperation returning variant.

NdbIndexOperation* NdbTransaction::getNdbIndexOperation ( const class NdbIndexImpl *  anIndex,
const class NdbTableImpl *  aTable,
NdbOperation aNextOp = 0,
bool  useRec = false 
) [private]

NdbIndexOperation* NdbTransaction::getNdbIndexOperation ( const NdbDictionary::Index anIndex  ) 

Get an operation from NdbIndexOperation idlelist and get the NdbTransaction object that was fetched by startTransaction pointing to this operation.

Parameters:
anIndex An index object (fetched by NdbDictionary::Dictionary::getIndex).
Returns:
Pointer to an NdbIndexOperation object if successful, otherwise NULL

NdbIndexOperation* NdbTransaction::getNdbIndexOperation ( const NdbDictionary::Index anIndex,
const NdbDictionary::Table aTable 
)

NdbIndexOperation* NdbTransaction::getNdbIndexOperation ( const char *  anIndexName,
const char *  aTableName 
)

Get an operation from NdbIndexOperation idlelist and get the NdbTransaction object that was fetched by startTransaction pointing to this operation.

Parameters:
anIndexName The index name (as created by createIndex).
aTableName The table name.
Returns:
Pointer to an NdbIndexOperation object if successful, otherwise NULL

NdbIndexScanOperation* NdbTransaction::getNdbIndexScanOperation ( const NdbIndexImpl *  index,
const NdbTableImpl *  table 
) [private]

NdbIndexScanOperation* NdbTransaction::getNdbIndexScanOperation ( const NdbDictionary::Index anIndex  ) 

Get an operation from NdbIndexScanOperation idlelist and get the NdbTransaction object which was fetched by startTransaction pointing to this operation.

Parameters:
anIndex An index object (fetched by NdbDictionary::Dictionary::getIndex).
Returns:
pointer to an NdbOperation object if successful, otherwise NULL

NdbIndexScanOperation* NdbTransaction::getNdbIndexScanOperation ( const NdbDictionary::Index anIndex,
const NdbDictionary::Table aTable 
)

NdbIndexScanOperation* NdbTransaction::getNdbIndexScanOperation ( const char *  anIndexName,
const char *  aTableName 
)

Get an operation from NdbIndexScanOperation idlelist and get the NdbTransaction object which was fetched by startTransaction pointing to this operation.

Parameters:
anIndexName The name of the index to use for scanning
aTableName The name of the table to scan
Returns:
pointer to an NdbOperation object if successful, otherwise NULL

NdbOperation* NdbTransaction::getNdbOperation ( const class NdbTableImpl *  aTable,
NdbOperation aNextOp = 0,
bool  useRec = false 
) [private]

NdbOperation* NdbTransaction::getNdbOperation ( const NdbDictionary::Table aTable  ) 

Get an NdbOperation for a table. Note that the operation has to be defined before it is executed.

Note:
All operations within the same transaction need to be initialized with this method.
Parameters:
aTable A table object (fetched by NdbDictionary::Dictionary::getTable)
Returns:
Pointer to an NdbOperation object if successful, otherwise NULL.

NdbOperation* NdbTransaction::getNdbOperation ( const char *  aTableName  ) 

Get an NdbOperation for a table. Note that the operation has to be defined before it is executed.

Note:
All operations within the same transaction need to be initialized with this method.
Parameters:
aTableName The table name.
Returns:
Pointer to an NdbOperation object if successful, otherwise NULL.

NdbIndexScanOperation* NdbTransaction::getNdbScanOperation ( const class NdbTableImpl *  aTable  )  [private]

NdbScanOperation* NdbTransaction::getNdbScanOperation ( const NdbDictionary::Table aTable  ) 

Get an operation from NdbScanOperation idlelist and get the NdbTransaction object which was fetched by startTransaction pointing to this operation.

Parameters:
aTable A table object (fetched by NdbDictionary::Dictionary::getTable)
Returns:
pointer to an NdbOperation object if successful, otherwise NULL

NdbScanOperation* NdbTransaction::getNdbScanOperation ( const char *  aTableName  ) 

Get an operation from NdbScanOperation idlelist and get the NdbTransaction object which was fetched by startTransaction pointing to this operation.

Parameters:
aTableName The table name.
Returns:
pointer to an NdbOperation object if successful, otherwise NULL

const NdbOperation* NdbTransaction::getNextCompletedOperation ( const NdbOperation op  )  const

Get completed (i.e. executed) operations of a transaction

This method should only be used after a transaction has been executed.

  • NdbTransaction::getNextCompletedOperation(NULL) returns the first NdbOperation object.
  • NdbTransaction::getNextCompletedOperation(op) returns the NdbOperation object defined after the NdbOperation "op".

This method is typically used to fetch all NdbOperation:s of a transaction to check for errors (use NdbOperation::getNdbError to fetch the NdbError object of an NdbOperation).

Note:
This method should only be used after the transaction has been executed and before the transaction has been closed.
Parameters:
op Operation, NULL means get first operation
Returns:
Operation "after" op

int NdbTransaction::getTC_ConnectPtr (  )  [private]

Uint64 NdbTransaction::getTransactionId (  ) 

Get transaction identity.

Returns:
Transaction id.

void NdbTransaction::handleExecuteCompletion (  )  [private]

bool NdbTransaction::hasBlobOperation (  )  [inline, private]

int NdbTransaction::init (  )  [private]

const NdbOperation* NdbTransaction::insertTuple ( const NdbRecord *  combined_rec,
const char *  combined_row,
const unsigned char *  mask = 0,
const NdbOperation::OperationOptions opts = 0,
Uint32  sizeOfOptions = 0 
)

const NdbOperation* NdbTransaction::insertTuple ( const NdbRecord *  key_rec,
const char *  key_row,
const NdbRecord *  attr_rec,
const char *  attr_row,
const unsigned char *  mask = 0,
const NdbOperation::OperationOptions opts = 0,
Uint32  sizeOfOptions = 0 
)

void NdbTransaction::next ( NdbTransaction  )  [private]

NdbTransaction* NdbTransaction::next (  )  [private]

int NdbTransaction::OpCompleteFailure ( NdbOperation  )  [private]

int NdbTransaction::OpCompleteSuccess (  )  [private]

NdbTransaction& NdbTransaction::operator= ( const NdbTransaction  )  [private]

void NdbTransaction::OpSent (  )  [private]

Uint32 NdbTransaction::ptr2int (  )  [private]

const NdbOperation* NdbTransaction::readTuple ( const NdbRecord *  key_rec,
const char *  key_row,
const NdbRecord *  result_rec,
char *  result_row,
NdbOperation::LockMode  lock_mode = NdbOperation::LM_Read,
const unsigned char *  result_mask = 0,
const NdbOperation::OperationOptions opts = 0,
Uint32  sizeOfOptions = 0 
)

int NdbTransaction::receiveDIHNDBTAMPER ( NdbApiSignal *  anApiSignal  )  [private]

int NdbTransaction::receiveSCAN_TABCONF ( NdbApiSignal *  ,
const Uint32 *  ,
Uint32  len 
) [private]

int NdbTransaction::receiveSCAN_TABREF ( NdbApiSignal *   )  [private]

int NdbTransaction::receiveTC_COMMITCONF ( const class TcCommitConf *  ,
Uint32  len 
) [private]

int NdbTransaction::receiveTC_COMMITREF ( NdbApiSignal *  anApiSignal  )  [private]

int NdbTransaction::receiveTCINDXCONF ( const class TcIndxConf *  ,
Uint32  aDataLength 
) [private]

int NdbTransaction::receiveTCINDXREF ( NdbApiSignal *   )  [private]

int NdbTransaction::receiveTCKEY_FAILCONF ( const class TcKeyFailConf *   )  [private]

int NdbTransaction::receiveTCKEY_FAILREF ( NdbApiSignal *  anApiSignal  )  [private]

int NdbTransaction::receiveTCKEYCONF ( const class TcKeyConf *  ,
Uint32  aDataLength 
) [private]

int NdbTransaction::receiveTCRELEASECONF ( NdbApiSignal *  anApiSignal  )  [private]

int NdbTransaction::receiveTCRELEASEREF ( NdbApiSignal *  anApiSignal  )  [private]

int NdbTransaction::receiveTCROLLBACKCONF ( NdbApiSignal *  anApiSignal  )  [private]

int NdbTransaction::receiveTCROLLBACKREF ( NdbApiSignal *  anApiSignal  )  [private]

int NdbTransaction::receiveTCROLLBACKREP ( NdbApiSignal *  anApiSignal  )  [private]

int NdbTransaction::receiveTCSEIZECONF ( NdbApiSignal *  anApiSignal  )  [private]

int NdbTransaction::receiveTCSEIZEREF ( NdbApiSignal *  anApiSignal  )  [private]

int NdbTransaction::refresh (  ) 

Refresh Update timeout counter of this transaction in the database. If you want to keep the transaction active in the database longer than the transaction abort timeout.

Note:
It's not advised to take a lock on a record and keep it for a extended time since this can impact other transactions.

void NdbTransaction::release (  )  [private]

void NdbTransaction::releaseCompletedOperations (  )  [private]

Release completed operations

void NdbTransaction::releaseExecutedScanOperation ( NdbIndexScanOperation  )  [private]

void NdbTransaction::releaseOperations (  )  [private]

void NdbTransaction::releaseOps ( NdbOperation  )  [private]

bool NdbTransaction::releaseScanOperation ( NdbIndexScanOperation **  listhead,
NdbIndexScanOperation **  listtail,
NdbIndexScanOperation op 
) [private]

void NdbTransaction::releaseScanOperations ( NdbIndexScanOperation  )  [private]

void NdbTransaction::remove_list ( NdbOperation *&  head,
NdbOperation  
) [private]

int NdbTransaction::report_node_failure ( Uint32  id  )  [private]

NdbIndexScanOperation* NdbTransaction::scanIndex ( const NdbRecord *  key_record,
const NdbRecord *  result_record,
NdbOperation::LockMode  lock_mode = NdbOperation::LM_Read,
const unsigned char *  result_mask = 0,
const NdbIndexScanOperation::IndexBound bound = 0,
const NdbScanOperation::ScanOptions options = 0,
Uint32  sizeOfOptions = 0 
)

Do an index range scan (optionally ordered) of a table.

The key_record describes the index to be scanned. It must be a key record for the index, ie. it must specify (at least) all the key columns of the index. And it must be created from the index to be scanned (not from the underlying table).

The result_record describes the rows to be returned from the scan. For an ordered index scan, result_record must be a key record for the index to be scanned, that is it must include at least all of the columns in the index (the reason is that the full index key is needed by NDBAPI for merge sorting the ordered rows returned from each fragment). The result_record must be created from the underlying table, not from the index to be scanned.

Both the key_record and result_record NdbRecord structures must stay in-place until the scan operation is closed.

A single IndexBound can either be specified in this call or in a separate call to NdbIndexScanOperation::setBound(). To perform a multi range read, the scan_flags in the ScanOptions structure must include SF_MULTIRANGE. Additional bounds can then be added using multiple calls to NdbIndexScanOperation::setBound().

To specify an equals bound, use the same row pointer for the low_key and high_key with the low and high inclusive bits set.

A ScanOptions structure can be passed, specifying extra options. See the definition of the ScanOptions structure for more information.

To enable backwards compatability of this interface, a sizeOfOptions parameter can be passed. This parameter indicates the size of the ScanOptions structure at the time the client was compiled, and enables detection of the use of an old ScanOptions structure. If this functionality is not required, it can be left set to zero.

NdbScanOperation* NdbTransaction::scanTable ( const NdbRecord *  result_record,
NdbOperation::LockMode  lock_mode = NdbOperation::LM_Read,
const unsigned char *  result_mask = 0,
const NdbScanOperation::ScanOptions options = 0,
Uint32  sizeOfOptions = 0 
)

Scan a table, using NdbRecord to read out column data.

The NdbRecord pointed to by result_record must remain valid until the scan operation is closed.

The result_mask pointer is optional, if present only columns for which the corresponding bit (by attribute id order) in result_mask is set will be retrieved in the scan. The result_mask is copied internally, so in contrast to result_record need not be valid at execute().

A ScanOptions structure can be passed, specifying extra options. See the definition of the NdbScanOperation::ScanOptions structure for more information.

To enable backwards compatability of this interface, a sizeOfOptions parameter can be passed. This parameter indicates the size of the ScanOptions structure at the time the client was compiled, and enables detection of the use of an old ScanOptions structure. If this functionality is not required, it can be left set to zero.

int NdbTransaction::sendCOMMIT (  )  [private]

int NdbTransaction::sendROLLBACK (  )  [private]

static void NdbTransaction::sendTC_COMMIT_ACK ( class TransporterFacade *  ,
NdbApiSignal *  ,
Uint32  transId1,
Uint32  transId2,
Uint32  aBlockRef 
) [static, private]

int NdbTransaction::sendTC_HBREP (  )  [private]

void NdbTransaction::set_send_size ( Uint32   )  [private]

void NdbTransaction::setBuddyConPtr ( Uint32   )  [private]

void NdbTransaction::setConnectedNodeId ( Uint32  nodeId,
Uint32  sequence 
) [private]

Set Connected node id and sequence no

void NdbTransaction::setErrorCode ( int  anErrorCode  )  [private]

void NdbTransaction::setGCI ( int  GCI  )  [private]

void NdbTransaction::setMyBlockReference ( int   )  [private]

void NdbTransaction::setOperationErrorCode ( int  anErrorCode  )  [private]

void NdbTransaction::setOperationErrorCodeAbort ( int  anErrorCode,
int  abortOption = -1 
) [private]

void NdbTransaction::setTC_ConnectPtr ( Uint32   )  [private]

void NdbTransaction::setTransactionId ( Uint64  aTransactionId  )  [private]

NdbOperation* NdbTransaction::setupRecordOp ( NdbOperation::OperationType  type,
NdbOperation::LockMode  lock_mode,
NdbOperation::AbortOption  default_ao,
const NdbRecord *  key_record,
const char *  key_row,
const NdbRecord *  attribute_record,
const char *  attribute_row,
const unsigned char *  mask,
const NdbOperation::OperationOptions opts,
Uint32  sizeOfOptions 
) [private]

void NdbTransaction::Status ( ConStatusType   )  [private]

ConStatusType NdbTransaction::Status (  )  [private]

const NdbOperation* NdbTransaction::updateTuple ( const NdbRecord *  key_rec,
const char *  key_row,
const NdbRecord *  attr_rec,
const char *  attr_row,
const unsigned char *  mask = 0,
const NdbOperation::OperationOptions opts = 0,
Uint32  sizeOfOptions = 0 
)

const NdbOperation* NdbTransaction::writeTuple ( const NdbRecord *  key_rec,
const char *  key_row,
const NdbRecord *  attr_rec,
const char *  attr_row,
const unsigned char *  mask = 0,
const NdbOperation::OperationOptions opts = 0,
Uint32  sizeOfOptions = 0 
)


Friends And Related Function Documentation

friend class HugoOperations [friend]

friend struct Ndb_free_list_t< NdbTransaction > [friend]


Member Data Documentation

Uint32 NdbTransaction::m_db_nodes[2] [private]

handle transaction spanning multiple TC/db nodes

1) Bitmask with used nodes 2) Bitmask with nodes failed during op

Uint32 NdbTransaction::m_failed_db_nodes[2] [private]

NdbAsynchCallback NdbTransaction::theCallbackFunction [private]

Uint32 NdbTransaction::theDBnode [private]

Uint32 NdbTransaction::theId [private]

Uint32 NdbTransaction::theMyRef [private]

Uint32 NdbTransaction::thePriority [private]

Uint32 NdbTransaction::theTCConPtr [private]


The documentation for this class was generated from the following file:

MySQL Cluster Database Blog

Based on MySQL Cluster 7.0.10.

This page is for information only and is not maintained by MySQL or Sun Microsystems - use at your own risk. For an upto date view of the API refer to the header files included with your MySQL Cluster distribution or check the MySQL Cluster API Developer Guide.