#include <NdbTransaction.hpp>
Collaboration diagram for NdbTransaction:

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:
execute() is equipped with an extra error handling parameter. There are two alternatives:
Definition at line 134 of file NdbTransaction.hpp.
typedef Uint64 NdbTransaction::TimeMillis_t [private] |
Definition at line 578 of file NdbTransaction.hpp.
Commit type of transaction
| AbortOnError | Abort transaction on failed operation. |
| AO_IgnoreError | Transaction continues on failed operation. |
Definition at line 151 of file NdbTransaction.hpp.
00151 { 00152 AbortOnError= 00153 #ifndef DOXYGEN_SHOULD_SKIP_INTERNAL 00154 ::AbortOnError 00155 #endif 00156 ,AO_IgnoreError= 00157 #ifndef DOXYGEN_SHOULD_SKIP_INTERNAL 00158 ::AO_IgnoreError 00159 #endif 00160 };
The commit status of the transaction.
| NotStarted | Transaction not yet started. |
| Started | Missing explanation |
| Committed | Transaction has been committed. |
| Aborted | Transaction has been aborted. |
| NeedAbort | Missing explanation |
Definition at line 481 of file NdbTransaction.hpp.
00481 { 00482 NotStarted, 00483 Started, 00484 Committed, 00485 Aborted, 00486 NeedAbort 00487 };
enum NdbTransaction::CompletionStatus [private] |
Definition at line 739 of file NdbTransaction.hpp.
00739 { 00740 NotCompleted, 00741 CompletedSuccess, 00742 CompletedFailure, 00743 DefinitionFailure 00744 } theCompletionStatus; // The Completion status of the transaction
enum NdbTransaction::ConStatusType [private] |
Definition at line 609 of file NdbTransaction.hpp.
00609 { 00610 NotConnected, 00611 Connecting, 00612 Connected, 00613 DisConnecting, 00614 ConnectFailure 00615 };
Execution type of transaction
Definition at line 165 of file NdbTransaction.hpp.
00165 { 00166 #ifndef DOXYGEN_SHOULD_SKIP_INTERNAL 00167 NoExecTypeDef= 00168 ::NoExecTypeDef, 00169 Prepare= ::Prepare, 00170 #endif 00171 NoCommit= 00172 00173 #ifndef DOXYGEN_SHOULD_SKIP_INTERNAL 00174 ::NoCommit 00175 #endif 00176 ,Commit= 00177 #ifndef DOXYGEN_SHOULD_SKIP_INTERNAL 00178 ::Commit 00179 #endif 00180 ,Rollback 00181 #ifndef DOXYGEN_SHOULD_SKIP_INTERNAL 00182 = ::Rollback 00183 #endif 00184 };
enum NdbTransaction::ListState [private] |
Definition at line 758 of file NdbTransaction.hpp.
00758 { 00759 NotInList, 00760 InPreparedList, 00761 InSendList, 00762 InCompletedList 00763 } theListState;
enum NdbTransaction::ReturnType [private] |
enum NdbTransaction::SendStatusType [private] |
| NotInit | |
| InitState | |
| sendOperations | |
| sendCompleted | |
| sendCOMMITstate | |
| sendABORT | |
| sendABORTfail | |
| sendTC_ROLLBACK | |
| sendTC_COMMIT | |
| sendTC_OP |
Definition at line 695 of file NdbTransaction.hpp.
00695 { 00696 NotInit, 00697 InitState, 00698 sendOperations, 00699 sendCompleted, 00700 sendCOMMITstate, 00701 sendABORT, 00702 sendABORTfail, 00703 sendTC_ROLLBACK, 00704 sendTC_COMMIT, 00705 sendTC_OP 00706 };
| NdbTransaction::NdbTransaction | ( | Ndb * | aNdb | ) | [private] |
Definition at line 44 of file NdbTransaction.cpp.
References CHECK_SZ, NdbError::code, m_db_nodes, m_failed_db_nodes, NdbObjectIdMap::map(), NotInList, theError, theId, Ndb::theImpl, theListState, theNdb, and NdbImpl::theNdbObjectIdMap.
00044 : 00045 theSendStatus(NotInit), 00046 theCallbackFunction(NULL), 00047 theCallbackObject(NULL), 00048 theTransArrayIndex(0), 00049 theStartTransTime(0), 00050 theErrorLine(0), 00051 theErrorOperation(NULL), 00052 theNdb(aNdb), 00053 theNext(NULL), 00054 theFirstOpInList(NULL), 00055 theLastOpInList(NULL), 00056 theFirstExecOpInList(NULL), 00057 theLastExecOpInList(NULL), 00058 theCompletedFirstOp(NULL), 00059 theCompletedLastOp(NULL), 00060 theNoOfOpSent(0), 00061 theNoOfOpCompleted(0), 00062 theNoOfOpFetched(0), 00063 theMyRef(0), 00064 theTCConPtr(0), 00065 theTransactionId(0), 00066 theGlobalCheckpointId(0), 00067 theStatus(NotConnected), 00068 theCompletionStatus(NotCompleted), 00069 theCommitStatus(NotStarted), 00070 theMagicNumber(0xFE11DC), 00071 theTransactionIsStarted(false), 00072 theDBnode(0), 00073 theReleaseOnClose(false), 00074 // Scan operations 00075 m_waitForReply(true), 00076 m_theFirstScanOperation(NULL), 00077 m_theLastScanOperation(NULL), 00078 m_firstExecutedScanOp(NULL), 00079 // Scan operations 00080 theScanningOp(NULL), 00081 theBuddyConPtr(0xFFFFFFFF), 00082 theBlobFlag(false), 00083 thePendingBlobOps(0) 00084 { 00085 theListState = NotInList; 00086 theError.code = 0; 00087 theId = theNdb->theImpl->theNdbObjectIdMap.map(this); 00088 00089 #define CHECK_SZ(mask, sz) assert((sizeof(mask)/sizeof(mask[0])) == sz) 00090 00091 CHECK_SZ(m_db_nodes, NdbNodeBitmask::Size); 00092 CHECK_SZ(m_failed_db_nodes, NdbNodeBitmask::Size); 00093 }//NdbTransaction::NdbTransaction()
Here is the call graph for this function:

| NdbTransaction::~NdbTransaction | ( | ) | [private] |
Definition at line 100 of file NdbTransaction.cpp.
References DBUG_ENTER, DBUG_VOID_RETURN, theId, Ndb::theImpl, theNdb, NdbImpl::theNdbObjectIdMap, and NdbObjectIdMap::unmap().
00101 { 00102 DBUG_ENTER("NdbTransaction::~NdbTransaction"); 00103 theNdb->theImpl->theNdbObjectIdMap.unmap(theId, this); 00104 DBUG_VOID_RETURN; 00105 }//NdbTransaction::~NdbTransaction()
Here is the call graph for this function:

| int NdbTransaction::checkMagicNumber | ( | ) | [inline, private] |
Definition at line 836 of file NdbTransaction.hpp.
References abort(), and theMagicNumber.
Referenced by Ndb::handleReceivedSignal().
00837 { 00838 if (theMagicNumber == 0x37412619) 00839 return 0; 00840 else { 00841 #ifdef NDB_NO_DROPPED_SIGNAL 00842 abort(); 00843 #endif 00844 return -1; 00845 } 00846 }
Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 850 of file NdbTransaction.hpp.
References Connected, theStatus, and theTransactionId.
Referenced by Ndb::handleReceivedSignal(), receiveSCAN_TABCONF(), receiveSCAN_TABREF(), receiveTC_COMMITREF(), receiveTCINDXREF(), receiveTCKEY_FAILREF(), receiveTCROLLBACKCONF(), receiveTCROLLBACKREF(), and receiveTCROLLBACKREP().
00850 { 00851 const Uint32 tTmp1 = transId[0]; 00852 const Uint32 tTmp2 = transId[1]; 00853 Uint64 tRecTransId = (Uint64)tTmp1 + ((Uint64)tTmp2 << 32); 00854 bool b = theStatus == Connected && theTransactionId == tRecTransId; 00855 return b; 00856 }
Here is the caller graph for this function:

| void NdbTransaction::close | ( | ) |
Definition at line 670 of file NdbTransaction.cpp.
References Ndb::closeTransaction(), and theNdb.
Referenced by populate(), and print_part_info().
00671 { 00672 theNdb->closeTransaction(this); 00673 }
Here is the call graph for this function:

Here is the caller graph for this function:

| NdbTransaction::CommitStatusType NdbTransaction::commitStatus | ( | ) |
Get the commit status of the transaction.
Definition at line 2088 of file NdbTransaction.cpp.
References theCommitStatus.
02089 { 02090 return theCommitStatus; 02091 }//NdbTransaction::commitStatus()
| void NdbTransaction::completedFail | ( | const char * | s | ) | [private] |
| void NdbTransaction::CompletedOperations | ( | ) | [private] |
| void NdbTransaction::define_scan_op | ( | NdbIndexScanOperation * | ) | [private] |
Definition at line 1288 of file NdbTransaction.cpp.
References m_theFirstScanOperation, m_theLastScanOperation, NdbOperation::next(), and NULL.
Referenced by NdbIndexScanOperation::reset_bounds().
01288 { 01289 // Link scan operation into list of cursor operations 01290 if (m_theLastScanOperation == NULL) 01291 m_theFirstScanOperation = m_theLastScanOperation = tOp; 01292 else { 01293 m_theLastScanOperation->next(tOp); 01294 m_theLastScanOperation = tOp; 01295 } 01296 tOp->next(NULL); 01297 }
Here is the call graph for this function:

Here is the caller graph for this function:

| int NdbTransaction::doSend | ( | ) | [private] |
Definition at line 734 of file NdbTransaction.cpp.
References abort(), Aborted, DBUG_ENTER, DBUG_RETURN, NdbOperation::doSend(), Ndb::insert_completed_list(), Ndb::insert_sent_list(), ndbout(), NdbOperation::next(), NULL, ReturnFailure, sendABORT, sendABORTfail, sendCOMMIT(), sendCOMMITstate, sendCompleted, sendOperations, sendROLLBACK(), sendTC_OP, setOperationErrorCodeAbort(), theCommitStatus, theDBnode, theFirstExecOpInList, theNdb, theReleaseOnClose, theReturnStatus, theSendStatus, and theTransactionIsStarted.
00735 { 00736 DBUG_ENTER("NdbTransaction::doSend"); 00737 00738 /* 00739 This method assumes that at least one operation have been defined. This 00740 is ensured by the caller of this routine (=execute). 00741 */ 00742 00743 switch(theSendStatus){ 00744 case sendOperations: { 00745 NdbOperation * tOp = theFirstExecOpInList; 00746 do { 00747 NdbOperation* tNextOp = tOp->next(); 00748 const Uint32 lastFlag = ((tNextOp == NULL) ? 1 : 0); 00749 const int tReturnCode = tOp->doSend(theDBnode, lastFlag); 00750 if (tReturnCode == -1) { 00751 theReturnStatus = ReturnFailure; 00752 break; 00753 }//if 00754 tOp = tNextOp; 00755 } while (tOp != NULL); 00756 Ndb* tNdb = theNdb; 00757 theSendStatus = sendTC_OP; 00758 theTransactionIsStarted = true; 00759 tNdb->insert_sent_list(this); 00760 DBUG_RETURN(0); 00761 }//case 00762 case sendABORT: 00763 case sendABORTfail:{ 00764 /*********************************************************************** 00765 * Rollback have been ordered on a not started transaction. 00766 * Simply return OK and set abort status. 00767 ***********************************************************************/ 00768 if (theSendStatus == sendABORTfail) { 00769 theReturnStatus = ReturnFailure; 00770 }//if 00771 if (sendROLLBACK() == 0) { 00772 DBUG_RETURN(0); 00773 }//if 00774 break; 00775 }//case 00776 case sendCOMMITstate: 00777 if (sendCOMMIT() == 0) { 00778 DBUG_RETURN(0); 00779 }//if 00780 break; 00781 case sendCompleted: 00782 theNdb->insert_completed_list(this); 00783 DBUG_RETURN(0); 00784 default: 00785 ndbout << "Inconsistent theSendStatus = " 00786 << (Uint32) theSendStatus << endl; 00787 abort(); 00788 break; 00789 }//switch 00790 setOperationErrorCodeAbort(4002); 00791 theReleaseOnClose = true; 00792 theTransactionIsStarted = false; 00793 theCommitStatus = Aborted; 00794 DBUG_RETURN(-1); 00795 }//NdbTransaction::doSend()
Here is the call graph for this function:

| int NdbTransaction::execute | ( | ::ExecType | execType, | |
| ::AbortOption | abortOption = ::AbortOnError, |
|||
| int | force = 0 | |||
| ) | [inline] |
Definition at line 323 of file NdbTransaction.hpp.
References execute().
00326 { return execute ((ExecType)execType,(AbortOption)abortOption,force); }
Here is the call graph for this function:

| int NdbTransaction::execute | ( | ExecType | execType, | |
| AbortOption | abortOption = AbortOnError, |
|||
| int | force = 0 | |||
| ) |
Executes transaction.
| 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 IgnoreError - Accept failing operations | |
| force | When operations should be sent to NDB Kernel. (See Adaptive Send Algorithm.)
|
Definition at line 265 of file NdbTransaction.cpp.
References assert, NdbError::code, Commit, DBUG_ENTER, DBUG_PRINT, DBUG_RETURN, executeNoBlobs(), n, ndbout(), NdbOperation::next(), NoCommit, NULL, NdbBlob::postExecute(), NdbBlob::preCommit(), NdbBlob::preExecute(), theBlobFlag, NdbOperation::theBlobList, theCompletedFirstOp, theCompletedLastOp, NdbOperation::theError, theError, theFirstOpInList, theLastOpInList, and NdbBlob::theNext.
Referenced by clear_table(), execute(), executeInsertTransaction(), executePendingBlobOps(), insert(), BackupRestore::logEntry(), main(), Ndb::opTupleIdOnNdb(), populate(), print_part_info(), NdbIndexStat::records_in_range(), release(), scan_delete(), scan_print(), scan_update(), scanReadRecords(), select_count(), and BackupRestore::update_apply_status().
00268 { 00269 NdbError savedError= theError; 00270 DBUG_ENTER("NdbTransaction::execute"); 00271 DBUG_PRINT("enter", ("aTypeOfExec: %d, abortOption: %d", 00272 aTypeOfExec, abortOption)); 00273 00274 if (! theBlobFlag) 00275 DBUG_RETURN(executeNoBlobs(aTypeOfExec, abortOption, forceSend)); 00276 00277 /* 00278 * execute prepared ops in batches, as requested by blobs 00279 * - blob error does not terminate execution 00280 * - blob error sets error on operation 00281 * - if error on operation skip blob calls 00282 */ 00283 00284 ExecType tExecType; 00285 NdbOperation* tPrepOp; 00286 NdbOperation* tCompletedFirstOp = NULL; 00287 NdbOperation* tCompletedLastOp = NULL; 00288 00289 int ret = 0; 00290 do { 00291 tExecType = aTypeOfExec; 00292 tPrepOp = theFirstOpInList; 00293 while (tPrepOp != NULL) { 00294 if (tPrepOp->theError.code == 0) { 00295 bool batch = false; 00296 NdbBlob* tBlob = tPrepOp->theBlobList; 00297 while (tBlob != NULL) { 00298 if (tBlob->preExecute(tExecType, batch) == -1) 00299 { 00300 ret = -1; 00301 if(savedError.code==0) 00302 savedError= theError; 00303 } 00304 tBlob = tBlob->theNext; 00305 } 00306 if (batch) { 00307 // blob asked to execute all up to here now 00308 tExecType = NoCommit; 00309 break; 00310 } 00311 } 00312 tPrepOp = tPrepOp->next(); 00313 } 00314 00315 // save rest of prepared ops if batch 00316 NdbOperation* tRestOp= 0; 00317 NdbOperation* tLastOp= 0; 00318 if (tPrepOp != NULL) { 00319 tRestOp = tPrepOp->next(); 00320 tPrepOp->next(NULL); 00321 tLastOp = theLastOpInList; 00322 theLastOpInList = tPrepOp; 00323 } 00324 00325 if (tExecType == Commit) { 00326 NdbOperation* tOp = theCompletedFirstOp; 00327 while (tOp != NULL) { 00328 if (tOp->theError.code == 0) { 00329 NdbBlob* tBlob = tOp->theBlobList; 00330 while (tBlob != NULL) { 00331 if (tBlob->preCommit() == -1) 00332 { 00333 ret = -1; 00334 if(savedError.code==0) 00335 savedError= theError; 00336 } 00337 tBlob = tBlob->theNext; 00338 } 00339 } 00340 tOp = tOp->next(); 00341 } 00342 } 00343 00344 // completed ops are in unspecified order 00345 if (theCompletedFirstOp != NULL) { 00346 if (tCompletedFirstOp == NULL) { 00347 tCompletedFirstOp = theCompletedFirstOp; 00348 tCompletedLastOp = theCompletedLastOp; 00349 } else { 00350 tCompletedLastOp->next(theCompletedFirstOp); 00351 tCompletedLastOp = theCompletedLastOp; 00352 } 00353 theCompletedFirstOp = NULL; 00354 theCompletedLastOp = NULL; 00355 } 00356 00357 if (executeNoBlobs(tExecType, abortOption, forceSend) == -1) 00358 { 00359 ret = -1; 00360 if(savedError.code==0) 00361 savedError= theError; 00362 } 00363 00364 #ifdef ndb_api_crash_on_complex_blob_abort 00365 assert(theFirstOpInList == NULL && theLastOpInList == NULL); 00366 #else 00367 theFirstOpInList = theLastOpInList = NULL; 00368 #endif 00369 00370 { 00371 NdbOperation* tOp = theCompletedFirstOp; 00372 while (tOp != NULL) { 00373 if (tOp->theError.code == 0) { 00374 NdbBlob* tBlob = tOp->theBlobList; 00375 while (tBlob != NULL) { 00376 // may add new operations if batch 00377 if (tBlob->postExecute(tExecType) == -1) 00378 { 00379 ret = -1; 00380 if(savedError.code==0) 00381 savedError= theError; 00382 } 00383 tBlob = tBlob->theNext; 00384 } 00385 } 00386 tOp = tOp->next(); 00387 } 00388 } 00389 00390 // add saved prepared ops if batch 00391 if (tPrepOp != NULL && tRestOp != NULL) { 00392 if (theFirstOpInList == NULL) 00393 theFirstOpInList = tRestOp; 00394 else 00395 theLastOpInList->next(tRestOp); 00396 theLastOpInList = tLastOp; 00397 } 00398 assert(theFirstOpInList == NULL || tExecType == NoCommit); 00399 } while (theFirstOpInList != NULL || tExecType != aTypeOfExec); 00400 00401 if (tCompletedFirstOp != NULL) { 00402 tCompletedLastOp->next(theCompletedFirstOp); 00403 theCompletedFirstOp = tCompletedFirstOp; 00404 if (theCompletedLastOp == NULL) 00405 theCompletedLastOp = tCompletedLastOp; 00406 } 00407 #if ndb_api_count_completed_ops_after_blob_execute 00408 { NdbOperation* tOp; unsigned n = 0; 00409 for (tOp = theCompletedFirstOp; tOp != NULL; tOp = tOp->next()) n++; 00410 ndbout << "completed ops: " << n << endl; 00411 } 00412 #endif 00413 00414 if(savedError.code!=0 && theError.code==4350) // Trans already aborted 00415 theError= savedError; 00416 00417 DBUG_RETURN(ret); 00418 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void NdbTransaction::executeAsynch | ( | ::ExecType | aTypeOfExec, | |
| NdbAsynchCallback | aCallback, | |||
| void * | anyObject, | |||
| ::AbortOption | abortOption = ::AbortOnError | |||
| ) | [inline] |
Definition at line 385 of file NdbTransaction.hpp.
References executeAsynch().
00389 { executeAsynch((ExecType)aTypeOfExec, aCallback, anyObject, 00390 (AbortOption)abortOption); }
Here is the call graph for this function:

| void NdbTransaction::executeAsynch | ( | ExecType | aTypeOfExec, | |
| NdbAsynchCallback | aCallback, | |||
| void * | anyObject, | |||
| AbortOption | abortOption = AbortOnError | |||
| ) |
Prepare and send an asynchronous transaction.
This method perform the same action as NdbTransaction::executeAsynchPrepare but also sends the operations to the NDB kernel.
See NdbTransaction::executeAsynchPrepare for information about the parameters of this method.
See secAsync for more information on how to use this method.
Referenced by executeAsynch().
Here is the caller graph for this function:

| void NdbTransaction::executeAsynchPrepare | ( | ::ExecType | execType, | |
| NdbAsynchCallback | callback, | |||
| void * | anyObject, | |||
| ::AbortOption | abortOption = ::AbortOnError | |||
| ) | [inline] |
Definition at line 359 of file NdbTransaction.hpp.
References executeAsynchPrepare().
00363 { executeAsynchPrepare((ExecType)execType, callback, anyObject, 00364 (AbortOption)abortOption); }
Here is the call graph for this function:

| void NdbTransaction::executeAsynchPrepare | ( | ExecType | execType, | |
| NdbAsynchCallback | callback, | |||
| void * | anyObject, | |||
| AbortOption | abortOption = AbortOnError | |||
| ) |
Prepare an asynchronous transaction.
See secAsync for more information on how to use this method.
| 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. | |
| callback | A callback method. This method gets called when the transaction has been executed. See ndbapi_async1.cpp for an example on how to specify and use a callback method. | |
| anyObject | A void pointer. This pointer is forwarded to the callback method and can be used to give the callback method some data to work on. It is up to the application programmer to decide on the use of this pointer. | |
| abortOption | see execute |
Reset error.code on execute
Definition at line 500 of file NdbTransaction.cpp.
References Aborted, BitmaskPOD< size >::clear(), NdbError::code, Commit, Committed, CompletedSuccess, DBUG_ENTER, DBUG_PRINT, DBUG_VOID_RETURN, NdbScanOperation::executeCursor(), InPreparedList, m_abortOption, m_db_nodes, m_failed_db_nodes, m_firstExecutedScanOp, m_theFirstScanOperation, m_theLastScanOperation, m_waitForReply, NdbOperation::next(), NotCompleted, NULL, NdbOperation::prepareSend(), ReturnSuccess, Rollback, sendABORT, sendABORTfail, sendCOMMITstate, sendCompleted, sendOperations, setErrorCode(), NdbOperation::setStartIndicator(), Started, theCallbackFunction, theCallbackObject, NdbOperation::theCommitIndicator, theCommitStatus, theCompletionStatus, theDBnode, theError, theFirstExecOpInList, theFirstOpInList, theLastExecOpInList, theLastOpInList, theListState, theNdb, theNoOfOpCompleted, theNoOfOpSent, Ndb::theNoOfPreparedTransactions, Ndb::thePreparedTransactionsArray, theReturnStatus, theSendStatus, theSimpleState, theTCConPtr, theTransactionId, theTransactionIsStarted, and theTransArrayIndex.
Referenced by executeAsynchPrepare(), executeNoBlobs(), main(), populate(), and BackupRestore::tuple_a().
00504 { 00505 DBUG_ENTER("NdbTransaction::executeAsynchPrepare"); 00506 DBUG_PRINT("enter", ("aTypeOfExec: %d, aCallback: %x, anyObject: %x", 00507 aTypeOfExec, aCallback, anyObject)); 00508 00512 if (theError.code != 0) 00513 DBUG_PRINT("enter", ("Resetting error %d on execute", theError.code)); 00514 theError.code = 0; 00515 NdbScanOperation* tcOp = m_theFirstScanOperation; 00516 if (tcOp != 0){ 00517 // Execute any cursor operations 00518 while (tcOp != NULL) { 00519 int tReturnCode; 00520 tReturnCode = tcOp->executeCursor(theDBnode); 00521 if (tReturnCode == -1) { 00522 DBUG_VOID_RETURN; 00523 }//if 00524 tcOp = (NdbScanOperation*)tcOp->next(); 00525 } // while 00526 m_theLastScanOperation->next(m_firstExecutedScanOp); 00527 m_firstExecutedScanOp = m_theFirstScanOperation; 00528 // Discard cursor operations, since these are also 00529 // in the complete operations list we do not need 00530 // to release them. 00531 m_theFirstScanOperation = m_theLastScanOperation = NULL; 00532 } 00533 00534 bool tTransactionIsStarted = theTransactionIsStarted; 00535 NdbOperation* tLastOp = theLastOpInList; 00536 Ndb* tNdb = theNdb; 00537 CommitStatusType tCommitStatus = theCommitStatus; 00538 Uint32 tnoOfPreparedTransactions = tNdb->theNoOfPreparedTransactions; 00539 00540 theReturnStatus = ReturnSuccess; 00541 theCallbackFunction = aCallback; 00542 theCallbackObject = anyObject; 00543 m_abortOption = abortOption; 00544 m_waitForReply = true; 00545 tNdb->thePreparedTransactionsArray[tnoOfPreparedTransactions] = this; 00546 theTransArrayIndex = tnoOfPreparedTransactions; 00547 theListState = InPreparedList; 00548 tNdb->theNoOfPreparedTransactions = tnoOfPreparedTransactions + 1; 00549 00550 if ((tCommitStatus != Started) || 00551 (aTypeOfExec == Rollback)) { 00552 /***************************************************************************** 00553 * Rollback have been ordered on a started transaction. Call rollback. 00554 * Could also be state problem or previous problem which leads to the 00555 * same action. 00556 ****************************************************************************/ 00557 if (aTypeOfExec == Rollback) { 00558 if (theTransactionIsStarted == false || theSimpleState) { 00559 theCommitStatus = Aborted; 00560 theSendStatus = sendCompleted; 00561 } else { 00562 theSendStatus = sendABORT; 00563 } 00564 } else { 00565 theSendStatus = sendABORTfail; 00566 }//if 00567 if (theCommitStatus == Aborted){ 00568 DBUG_PRINT("exit", ("theCommitStatus: Aborted")); 00569 setErrorCode(4350); 00570 } 00571 DBUG_VOID_RETURN; 00572 }//if 00573 if (tTransactionIsStarted == true) { 00574 if (tLastOp != NULL) { 00575 if (aTypeOfExec == Commit) { 00576 /***************************************************************************** 00577 * Set commit indicator on last operation when commit has been ordered 00578 * and also a number of operations. 00579 ******************************************************************************/ 00580 tLastOp->theCommitIndicator = 1; 00581 }//if 00582 } else { 00583 if (aTypeOfExec == Commit && !theSimpleState) { 00584 /********************************************************************** 00585 * A Transaction have been started and no more operations exist. 00586 * We will use the commit method. 00587 *********************************************************************/ 00588 theSendStatus = sendCOMMITstate; 00589 DBUG_VOID_RETURN; 00590 } else { 00591 /********************************************************************** 00592 * We need to put it into the array of completed transactions to 00593 * ensure that we report the completion in a proper way. 00594 * We cannot do this here since that would endanger the completed 00595 * transaction array since that is also updated from the receiver 00596 * thread and thus we need to do it under mutex lock and thus we 00597 * set the sendStatus to ensure that the send method will 00598 * put it into the completed array. 00599 **********************************************************************/ 00600 theSendStatus = sendCompleted; 00601 DBUG_VOID_RETURN; // No Commit with no operations is OK 00602 }//if 00603 }//if 00604 } else if (tTransactionIsStarted == false) { 00605 NdbOperation* tFirstOp = theFirstOpInList; 00606 if (tLastOp != NULL) { 00607 tFirstOp->setStartIndicator(); 00608 if (aTypeOfExec == Commit) { 00609 tLastOp->theCommitIndicator = 1; 00610 }//if 00611 } else { 00612 /*********************************************************************** 00613 * No operations are defined and we have not started yet. 00614 * Simply return OK. Set commit status if Commit. 00615 ***********************************************************************/ 00616 if (aTypeOfExec == Commit) { 00617 theCommitStatus = Committed; 00618 }//if 00619 /*********************************************************************** 00620 * We need to put it into the array of completed transactions to 00621 * ensure that we report the completion in a proper way. We 00622 * cannot do this here since that would endanger the completed 00623 * transaction array since that is also updated from the 00624 * receiver thread and thus we need to do it under mutex lock 00625 * and thus we set the sendStatus to ensure that the send method 00626 * will put it into the completed array. 00627 ***********************************************************************/ 00628 theSendStatus = sendCompleted; 00629 DBUG_VOID_RETURN; 00630 }//if 00631 } 00632 00633 NdbOperation* tOp = theFirstOpInList; 00634 theCompletionStatus = NotCompleted; 00635 while (tOp) { 00636 int tReturnCode; 00637 NdbOperation* tNextOp = tOp->next(); 00638 00639 tReturnCode = tOp->prepareSend(theTCConPtr, theTransactionId); 00640 if (tReturnCode == -1) { 00641 theSendStatus = sendABORTfail; 00642 DBUG_VOID_RETURN; 00643 }//if 00644 00645 /************************************************************************* 00646 * Now that we have successfully prepared the send of this operation we 00647 * move it to the list of executing operations and remove it from the 00648 * list of defined operations. 00649 ************************************************************************/ 00650 tOp = tNextOp; 00651 } 00652 00653 NdbOperation* tLastOpInList = theLastOpInList; 00654 NdbOperation* tFirstOpInList = theFirstOpInList; 00655 00656 theFirstOpInList = NULL; 00657 theLastOpInList = NULL; 00658 theFirstExecOpInList = tFirstOpInList; 00659 theLastExecOpInList = tLastOpInList; 00660 00661 theCompletionStatus = CompletedSuccess; 00662 theNoOfOpSent = 0; 00663 theNoOfOpCompleted = 0; 00664 theSendStatus = sendOperations; 00665 NdbNodeBitmask::clear(m_db_nodes); 00666 NdbNodeBitmask::clear(m_failed_db_nodes); 00667 DBUG_VOID_RETURN; 00668 }//NdbTransaction::executeAsynchPrepare()
Here is the call graph for this function:

Here is the caller graph for this function:

| int NdbTransaction::executeNoBlobs | ( | ExecType | execType, | |
| AbortOption | abortOption = AbortOnError, |
|||
| int | force = 0 | |||
| ) | [private] |
Definition at line 421 of file NdbTransaction.cpp.
References abort(), DBUG_ENTER, DBUG_PRINT, DBUG_RETURN, executeAsynchPrepare(), NdbImpl::m_transporter_facade, TransporterFacade::m_waitfor_timeout, m_waitForReply, ndbout(), NotInList, NULL, ReturnFailure, Ndb::sendPollNdb(), setOperationErrorCodeAbort(), Ndb::theCompletedTransactionsArray, Ndb::theImpl, theListState, theNdb, Ndb::theNoOfCompletedTransactions, Ndb::theNoOfPreparedTransactions, Ndb::theNoOfSentTransactions, thePendingBlobOps, Ndb::thePreparedTransactionsArray, theReturnStatus, and Ndb::theSentTransactionsArray.
Referenced by NdbBlob::deletePartsUnknown(), execute(), NdbBlob::executePendingBlobReads(), and NdbBlob::executePendingBlobWrites().
00424 { 00425 DBUG_ENTER("NdbTransaction::executeNoBlobs"); 00426 DBUG_PRINT("enter", ("aTypeOfExec: %d, abortOption: %d", 00427 aTypeOfExec, abortOption)); 00428 00429 //------------------------------------------------------------------------ 00430 // We will start by preparing all operations in the transaction defined 00431 // since last execute or since beginning. If this works ok we will continue 00432 // by calling the poll with wait method. This method will return when 00433 // the NDB kernel has completed its task or when 10 seconds have passed. 00434 // The NdbTransactionCallBack-method will receive the return code of the 00435 // transaction. The normal methods of reading error codes still apply. 00436 //------------------------------------------------------------------------ 00437 Ndb* tNdb = theNdb; 00438 00439 Uint32 timeout = theNdb->theImpl->m_transporter_facade->m_waitfor_timeout; 00440 m_waitForReply = false; 00441 executeAsynchPrepare(aTypeOfExec, NULL, NULL, abortOption); 00442 if (m_waitForReply){ 00443 while (1) { 00444 int noOfComp = tNdb->sendPollNdb(3 * timeout, 1, forceSend); 00445 if (noOfComp == 0) { 00449 ndbout << "This timeout should never occur, execute(..)" << endl; 00450 setOperationErrorCodeAbort(4012); // Error code for "Cluster Failure" 00451 DBUG_RETURN(-1); 00452 }//if 00453 00454 /* 00455 * Check that the completed transactions include this one. There 00456 * could be another thread running asynchronously. Even in pure 00457 * async case rollback is done synchronously. 00458 */ 00459 if (theListState != NotInList) 00460 continue; 00461 #ifdef VM_TRACE 00462 unsigned anyway = 0; 00463 for (unsigned i = 0; i < theNdb->theNoOfPreparedTransactions; i++) 00464 anyway += theNdb->thePreparedTransactionsArray[i] == this; 00465 for (unsigned i = 0; i < theNdb->theNoOfSentTransactions; i++) 00466 anyway += theNdb->theSentTransactionsArray[i] == this; 00467 for (unsigned i = 0; i < theNdb->theNoOfCompletedTransactions; i++) 00468 anyway += theNdb->theCompletedTransactionsArray[i] == this; 00469 if (anyway) { 00470 theNdb->printState("execute %x", this); 00471 abort(); 00472 } 00473 #endif 00474 if (theReturnStatus == ReturnFailure) { 00475 DBUG_RETURN(-1); 00476 }//if 00477 break; 00478 } 00479 } 00480 thePendingBlobOps = 0; 00481 DBUG_RETURN(0); 00482 }//NdbTransaction::execute()
Here is the call graph for this function:

Here is the caller graph for this function:

| int NdbTransaction::executePendingBlobOps | ( | Uint8 | flags = 0xFF |
) | [inline] |
Execute the transaction in NoCommit mode if there are any not-yet executed blob part operations of given types. Otherwise do nothing. The flags argument is bitwise OR of (1 << optype) where optype comes from NdbOperation::OperationType. Only the basic PK ops are used (read, insert, update, delete).
Definition at line 1037 of file NdbTransaction.hpp.
References execute(), NoCommit, and thePendingBlobOps.
Referenced by NdbScanOperation::nextResult().
01038 { 01039 if (thePendingBlobOps & flags) { 01040 // not executeNoBlobs because there can be new ops with blobs 01041 return execute(NoCommit); 01042 } 01043 return 0; 01044 }
Here is the call graph for this function:

Here is the caller graph for this function:

| Uint32 NdbTransaction::get_send_size | ( | ) | [inline, private] |
| Uint32 NdbTransaction::getBuddyConPtr | ( | ) | [inline, private] |
Definition at line 935 of file NdbTransaction.hpp.
References theBuddyConPtr.
00936 { 00937 return theBuddyConPtr; 00938 }
| Uint32 NdbTransaction::getConnectedNodeId | ( | ) | [inline] |
Get nodeId of TC for this transaction
Definition at line 885 of file NdbTransaction.hpp.
References theDBnode.
Referenced by Ndb::closeTransaction(), Ndb::hupp(), and Ndb::releaseConnectToNdb().
00886 { 00887 return theDBnode; 00888 }
Here is the caller graph for this function:

| const NdbOperation* NdbTransaction::getFirstDefinedOperation | ( | ) | const [inline] |
Definition at line 552 of file NdbTransaction.hpp.
References theFirstOpInList.
00552 {return theFirstOpInList;}
| int NdbTransaction::getGCI | ( | ) |
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.
Definition at line 2068 of file NdbTransaction.cpp.
References Committed, theCommitStatus, and theGlobalCheckpointId.
02069 { 02070 if (theCommitStatus == NdbTransaction::Committed) { 02071 return theGlobalCheckpointId; 02072 }//if 02073 return 0; 02074 }//NdbTransaction::getGCI()
| const NdbOperation* NdbTransaction::getLastDefinedOperation | ( | ) | const [inline] |
Definition at line 553 of file NdbTransaction.hpp.
References theLastOpInList.
00553 {return theLastOpInList;}
| const NdbError & NdbTransaction::getNdbError | ( | ) | const |
Get error object with information about the latest error.
Definition at line 58 of file Ndberr.cpp.
References theError, and update.
Referenced by asynchErrorHandler(), callback(), clear_table(), BackupRestore::errorHandler(), BackupRestore::logEntry(), main(), populate(), NdbIndexStat::records_in_range(), scan_delete(), scan_print(), scan_update(), scanReadRecords(), select_count(), BackupRestore::tuple_a(), and BackupRestore::update_apply_status().
Here is the caller graph for this function:

| int NdbTransaction::getNdbErrorLine | ( | ) |
Get the method number where the latest error occured.
Definition at line 2094 of file NdbTransaction.cpp.
References theErrorLine.
02095 { 02096 return theErrorLine; 02097 }
| 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.
Definition at line 2100 of file NdbTransaction.cpp.
References theErrorOperation.
02101 { 02102 return theErrorOperation; 02103 }//NdbTransaction::getNdbErrorOperation()
| NdbIndexOperation* NdbTransaction::getNdbIndexOperation | ( | const class NdbIndexImpl * | anIndex, | |
| const class NdbTableImpl * | aTable, | |||
| NdbOperation * | aNextOp = 0 | |||
| ) | [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.
| anIndex | An index object (fetched by NdbDictionary::Dictionary::getIndex). |
Definition at line 1419 of file NdbTransaction.cpp.
References NdbError::code, NdbDictionaryImpl::getNdbError(), getNdbIndexOperation(), NdbDictionaryImpl::getTable(), index(), NULL, setOperationErrorCodeAbort(), Ndb::theDictionary, and theNdb.
01420 { 01421 if (index) 01422 { 01423 const NdbDictionary::Table *table= 01424 theNdb->theDictionary->getTable(index->getTable()); 01425 01426 if (table) 01427 return getNdbIndexOperation(index, table); 01428 01429 setOperationErrorCodeAbort(theNdb->theDictionary->getNdbError().code); 01430 return NULL; 01431 } 01432 setOperationErrorCodeAbort(4271); 01433 return NULL; 01434 }
Here is the call graph for this function:

| NdbIndexOperation * NdbTransaction::getNdbIndexOperation | ( | const NdbDictionary::Index * | anIndex, | |
| const NdbDictionary::Table * | aTable | |||
| ) |
Definition at line 1437 of file NdbTransaction.cpp.
References NdbTableImpl::getImpl(), NdbIndexImpl::getImpl(), getNdbIndexOperation(), index(), NULL, and setOperationErrorCodeAbort().
01439 { 01440 if (index && table) 01441 return getNdbIndexOperation(& NdbIndexImpl::getImpl(*index), 01442 & NdbTableImpl::getImpl(*table)); 01443 01444 setOperationErrorCodeAbort(4271); 01445 return NULL; 01446 }//NdbTransaction::getNdbIndexOperation()
Here is the call graph for this function:

| 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.
| anIndexName | The index name (as created by createIndex). | |
| aTableName | The table name. |
Definition at line 1322 of file NdbTransaction.cpp.
References BaseString::append(), BaseString::c_str(), NdbError::code, UtilBuffer::get_data(), NdbDictionaryImpl::getIndex(), NdbDictionaryImpl::getNdbError(), NdbDictionaryImpl::getTable(), index(), NdbTableImpl::m_frm, NULL, setOperationErrorCodeAbort(), Started, theCommitStatus, Ndb::theDictionary, and theNdb.
Referenced by getNdbIndexOperation(), main(), and NdbBlob::preExecute().
01324 { 01325 if (theCommitStatus == Started) { 01326 NdbTableImpl * table = theNdb->theDictionary->getTable(aTableName); 01327 NdbIndexImpl * index; 01328 01329 if (table == 0) 01330 { 01331 setOperationErrorCodeAbort(theNdb->theDictionary->getNdbError().code); 01332 return NULL; 01333 } 01334 01335 if (table->m_frm.get_data()) 01336 { 01337 // This unique index is defined from SQL level 01338 static const char* uniqueSuffix= "$unique"; 01339 BaseString uniqueIndexName(anIndexName); 01340 uniqueIndexName.append(uniqueSuffix); 01341 index = theNdb->theDictionary->getIndex(uniqueIndexName.c_str(), 01342 aTableName); 01343 } 01344 else 01345 index = theNdb->theDictionary->getIndex(anIndexName, 01346 aTableName); 01347 if(table != 0 && index != 0){ 01348 return getNdbIndexOperation(index, table); 01349 } 01350 01351 if(index == 0){ 01352 setOperationErrorCodeAbort(4243); 01353 return NULL; 01354 } 01355 01356 setOperationErrorCodeAbort(4243); 01357 return NULL; 01358 } 01359 01360 setOperationErrorCodeAbort(4114); 01361 return 0; 01362 }//NdbTransaction::getNdbIndexOperation()
Here is the call graph for this function:

Here is the caller graph for this function:

| NdbIndexScanOperation * NdbTransaction::getNdbIndexScanOperation | ( | const NdbIndexImpl * | index, | |
| const NdbTableImpl * | table | |||
| ) | [private] |
Definition at line 1187 of file NdbTransaction.cpp.
References getNdbScanOperation(), index(), NdbOperation::m_currentTable, NdbOperation::m_type, NULL, NdbOperation::OrderedIndexScan, setOperationErrorCodeAbort(), Started, and theCommitStatus.
01189 { 01190 if (theCommitStatus == Started){ 01191 const NdbTableImpl * indexTable = index->getIndexTable(); 01192 if (indexTable != 0){ 01193 NdbIndexScanOperation* tOp = getNdbScanOperation(indexTable); 01194 if(tOp) 01195 { 01196 tOp->m_currentTable = table; 01197 // Mark that this really an NdbIndexScanOperation 01198 tOp->m_type = NdbOperation::OrderedIndexScan; 01199 } 01200 return tOp; 01201 } else { 01202 setOperationErrorCodeAbort(4271); 01203 return NULL; 01204 }//if 01205 } 01206 01207 setOperationErrorCodeAbort(4114); 01208 return NULL; 01209 }//NdbTransaction::getNdbIndexScanOperation()
Here is the call graph for this function:

| 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.
| anIndex | An index object (fetched by NdbDictionary::Dictionary::getIndex). |
Definition at line 1212 of file NdbTransaction.cpp.
References NdbError::code, NdbDictionaryImpl::getNdbError(), getNdbIndexScanOperation(), NdbDictionaryImpl::getTable(), index(), NULL, setOperationErrorCodeAbort(), Ndb::theDictionary, and theNdb.
01213 { 01214 if (index) 01215 { 01216 const NdbDictionary::Table *table= 01217 theNdb->theDictionary->getTable(index->getTable()); 01218 01219 if (table) 01220 return getNdbIndexScanOperation(index, table); 01221 01222 setOperationErrorCodeAbort(theNdb->theDictionary->getNdbError().code); 01223 return NULL; 01224 } 01225 setOperationErrorCodeAbort(4271); 01226 return NULL; 01227 }
Here is the call graph for this function:

| NdbIndexScanOperation * NdbTransaction::getNdbIndexScanOperation | ( | const NdbDictionary::Index * | anIndex, | |
| const NdbDictionary::Table * | aTable | |||
| ) |
Definition at line 1230 of file NdbTransaction.cpp.
References NdbTableImpl::getImpl(), NdbIndexImpl::getImpl(), getNdbIndexScanOperation(), index(), NULL, and setOperationErrorCodeAbort().
01232 { 01233 if (index && table) 01234 return getNdbIndexScanOperation(& NdbIndexImpl::getImpl(*index), 01235 & NdbTableImpl::getImpl(*table)); 01236 setOperationErrorCodeAbort(4271); 01237 return NULL; 01238 }//NdbTransaction::getNdbIndexScanOperation()
Here is the call graph for this function:

| 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.
| anIndexName | The index name. | |
| aTableName | The table name. |
Definition at line 1166 of file NdbTransaction.cpp.
References NdbError::code, NdbDictionaryImpl::getIndex(), NdbDictionaryImpl::getNdbError(), NdbDictionaryImpl::getTable(), index(), setOperationErrorCodeAbort(), Ndb::theDictionary, and theNdb.
Referenced by getNdbIndexScanOperation(), and scanReadRecords().
01168 { 01169 NdbIndexImpl* index = 01170 theNdb->theDictionary->getIndex(anIndexName, aTableName); 01171 if (index == 0) 01172 { 01173 setOperationErrorCodeAbort(theNdb->theDictionary->getNdbError().code); 01174 return 0; 01175 } 01176 NdbTableImpl* table = theNdb->theDictionary->getTable(aTableName); 01177 if (table == 0) 01178 { 01179 setOperationErrorCodeAbort(theNdb->theDictionary->getNdbError().code); 01180 return 0; 01181 } 01182 01183 return getNdbIndexScanOperation(index, table); 01184 }
Here is the call graph for this function:

Here is the caller graph for this function:

| NdbOperation* NdbTransaction::getNdbOperation | ( | const class NdbTableImpl * | aTable, | |
| NdbOperation * | aNextOp = 0 | |||
| ) | [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.
| aTable | A table object (fetched by NdbDictionary::Dictionary::getTable) |
Definition at line 1118 of file NdbTransaction.cpp.
References NdbTableImpl::getImpl(), getNdbOperation(), and NULL.
01119 { 01120 if (table) 01121 return getNdbOperation(& NdbTableImpl::getImpl(*table)); 01122 else 01123 return NULL; 01124 }//NdbTransaction::getNdbOperation()
Here is the call graph for this function:

| NdbOperation * NdbTransaction::getNdbOperation | ( | const char * | aTableName | ) |
Get an NdbOperation for a table. Note that the operation has to be defined before it is executed.
| aTableName | The table name. |
Definition at line 1041 of file NdbTransaction.cpp.
References NdbError::code, NdbDictionaryImpl::getNdbError(), NdbDictionaryImpl::getTable(), NULL, setErrorCode(), setOperationErrorCodeAbort(), Started, theCommitStatus, Ndb::theDictionary, and theNdb.
Referenced by NdbBlob::deleteParts(), NdbBlob::deletePartsUnknown(), getNdbOperation(), insert(), NdbBlob::insertParts(), BackupRestore::logEntry(), main(), Ndb::opTupleIdOnNdb(), populate(), NdbBlob::postExecute(), NdbBlob::preCommit(), NdbBlob::preExecute(), NdbBlob::readTableParts(), NdbScanOperation::takeOverScanOp(), BackupRestore::tuple_a(), BackupRestore::update_apply_status(), and NdbBlob::updateParts().
01042 { 01043 if (theCommitStatus == Started){ 01044 NdbTableImpl* table = theNdb->theDictionary->getTable(aTableName); 01045 if (table != 0){ 01046 return getNdbOperation(table); 01047 } else { 01048 setErrorCode(theNdb->theDictionary->getNdbError().code); 01049 return NULL; 01050 }//if 01051 } 01052 01053 setOperationErrorCodeAbort(4114); 01054 01055 return NULL; 01056 }//NdbTransaction::getNdbOperation()
Here is the call graph for this function:

Here is the caller graph for this function:

| 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.
| aTable | A table object (fetched by NdbDictionary::Dictionary::getTable) |
Definition at line 1300 of file NdbTransaction.cpp.
References NdbTableImpl::getImpl(), getNdbScanOperation(), and NULL.
01301 { 01302 if (table) 01303 return getNdbScanOperation(& NdbTableImpl::getImpl(*table)); 01304 else 01305 return NULL; 01306 }//NdbTransaction::getNdbScanOperation()
Here is the call graph for this function:

| 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.
| aTableName | The table name. |
Definition at line 1138 of file NdbTransaction.cpp.
References NdbError::code, NdbDictionaryImpl::getTable(), NdbDictionaryImpl::m_error, NULL, setOperationErrorCodeAbort(), Started, theCommitStatus, Ndb::theDictionary, and theNdb.
Referenced by clear_table(), getNdbIndexScanOperation(), getNdbScanOperation(), print_part_info(), scan_delete(), scan_print(), scan_update(), scanReadRecords(), and select_count().
01139 { 01140 if (theCommitStatus == Started){ 01141 NdbTableImpl* tab = theNdb->theDictionary->getTable(aTableName); 01142 if (tab != 0){ 01143 return getNdbScanOperation(tab); 01144 } else { 01145 setOperationErrorCodeAbort(theNdb->theDictionary->m_error.code); 01146 return NULL; 01147 }//if 01148 } 01149 01150 setOperationErrorCodeAbort(4114); 01151 return NULL; 01152 }//NdbTransaction::getNdbScanOperation()
Here is the call graph for this function:

Here is the caller graph for this function:

| 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.
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).
| op | Operation, NULL means get first operation |
Definition at line 2106 of file NdbTransaction.cpp.
References theCompletedFirstOp, and NdbOperation::theNext.
Referenced by printTransactionError().
02106 { 02107 if(current == 0) 02108 return theCompletedFirstOp; 02109 return current->theNext; 02110 }
Here is the caller graph for this function:

| int NdbTransaction::getTC_ConnectPtr | ( | ) | [inline, private] |
Definition at line 922 of file NdbTransaction.hpp.
References theTCConPtr.
Referenced by Ndb::hupp(), and Ndb::releaseConnectToNdb().
00923 { 00924 return theTCConPtr; 00925 }
Here is the caller graph for this function:

| Uint64 NdbTransaction::getTransactionId | ( | ) |
Get transaction identity.
Definition at line 2082 of file NdbTransaction.cpp.
References theTransactionId.
Referenced by NdbOperation::checkState_TransId(), Ndb::closeTransaction(), Ndb::hupp(), and Ndb::startTransaction().
02083 { 02084 return theTransactionId; 02085 }//NdbTransaction::getTransactionId()
Here is the caller graph for this function:

| void NdbTransaction::handleExecuteCompletion | ( | ) | [private] |
Definition at line 236 of file NdbTransaction.cpp.
References InitState, NdbOperation::next(), NULL, theCompletedFirstOp, theCompletedLastOp, theFirstExecOpInList, theLastExecOpInList, and theSendStatus.
Referenced by Ndb::completedTransaction().
00237 { 00238 /*************************************************************************** 00239 * Move the NdbOperation objects from the list of executing 00240 * operations to list of completed 00241 **************************************************************************/ 00242 NdbOperation* tFirstExecOp = theFirstExecOpInList; 00243 NdbOperation* tLastExecOp = theLastExecOpInList; 00244 if (tLastExecOp != NULL) { 00245 tLastExecOp->next(theCompletedFirstOp); 00246 theCompletedFirstOp = tFirstExecOp; 00247 if (theCompletedLastOp == NULL) 00248 theCompletedLastOp = tLastExecOp; 00249 theFirstExecOpInList = NULL; 00250 theLastExecOpInList = NULL; 00251 }//if 00252 theSendStatus = InitState; 00253 return; 00254 }//NdbTransaction::handleExecuteCompletion()
Here is the call graph for this function:

Here is the caller graph for this function:

| bool NdbTransaction::hasBlobOperation | ( | ) | [inline, private] |
Definition at line 795 of file NdbTransaction.hpp.
References theBlobFlag.
00795 { return theBlobFlag; }
| void NdbTransaction::init | ( | ) | [private] |
Definition at line 113 of file NdbTransaction.cpp.
References AbortOnError, NdbError::code, InitState, m_abortOption, m_firstExecutedScanOp, m_theFirstScanOperation, m_theLastScanOperation, m_waitForReply, NotCompleted, NotInList, NULL, Started, theBlobFlag, theBuddyConPtr, theCommitStatus, theCompletedFirstOp, theCompletedLastOp, theCompletionStatus, theError, theErrorLine, theErrorOperation, theFirstExecOpInList, theFirstOpInList, theGlobalCheckpointId, theInUseState, theLastExecOpInList, theLastOpInList, theListState, theMagicNumber, theNext, thePendingBlobOps, theReleaseOnClose, theScanningOp, theSendStatus, theSimpleState, and theTransactionIsStarted.
Referenced by Ndb::startTransactionLocal().
00114 { 00115 theListState = NotInList; 00116 theInUseState = true; 00117 theTransactionIsStarted = false; 00118 theNext = NULL; 00119 00120 theFirstOpInList = NULL; 00121 theLastOpInList = NULL; 00122 00123 theScanningOp = NULL; 00124 00125 theFirstExecOpInList = NULL; 00126 theLastExecOpInList = NULL; 00127 00128 theCompletedFirstOp = NULL; 00129 theCompletedLastOp = NULL; 00130 00131 theGlobalCheckpointId = 0; 00132 theCommitStatus = Started; 00133 theCompletionStatus = NotCompleted; 00134 m_abortOption = AbortOnError; 00135 00136 theError.code = 0; 00137 theErrorLine = 0; 00138 theErrorOperation = NULL; 00139 00140 theReleaseOnClose = false; 00141 theSimpleState = true; 00142 theSendStatus = InitState; 00143 theMagicNumber = 0x37412619; 00144 // Scan operations 00145 m_waitForReply = true; 00146 m_theFirstScanOperation = NULL; 00147 m_theLastScanOperation = NULL; 00148 m_firstExecutedScanOp = 0; 00149 theBuddyConPtr = 0xFFFFFFFF; 00150 // 00151 theBlobFlag = false; 00152 thePendingBlobOps = 0; 00153 }//NdbTransaction::init()
Here is the caller graph for this function:

| void NdbTransaction::next | ( | NdbTransaction * | ) | [inline, private] |
Definition at line 974 of file NdbTransaction.hpp.
References theNext.
00975 { 00976 theNext = aTransaction; 00977 }
| NdbTransaction * NdbTransaction::next | ( | ) | [inline, private] |
Definition at line 961 of file NdbTransaction.hpp.
References theNext.
Referenced by Ndb::checkFailedNode(), Ndb::closeTransaction(), releaseScanOperations(), and Ndb::startTransactionLocal().
00962 { 00963 return theNext; 00964 }
Here is the caller graph for this function:

Definition at line 2003 of file NdbTransaction.cpp.
References AO_IgnoreError, CompletedFailure, setOperationErrorCodeAbort(), theCompletionStatus, theNoOfOpCompleted, and theNoOfOpSent.
Referenced by NdbOperation::receiveTCKEYREF().
02004 { 02005 Uint32 tNoComp = theNoOfOpCompleted; 02006 Uint32 tNoSent = theNoOfOpSent; 02007 if (setFailure) 02008 theCompletionStatus = NdbTransaction::CompletedFailure; 02009 tNoComp++; 02010 theNoOfOpCompleted = tNoComp; 02011 if (tNoComp == tNoSent) { 02012 //------------------------------------------------------------------------ 02013 //If the transaction consists of only simple reads we can set 02014 //Commit state Aborted. Otherwise this simple operation cannot 02015 //decide the success of the whole transaction since a simple 02016 //operation is not really part of that transaction. 02017 //------------------------------------------------------------------------ 02018 if (abortOption == AO_IgnoreError){ 02022 return -1; 02023 } 02024 02025 return 0; // Last operation received 02026 } else if (tNoComp > tNoSent) { 02027 setOperationErrorCodeAbort(4113); // Too many operations, 02028 // stop waiting for more 02029 return 0; 02030 } else { 02031 return -1; // Continue waiting for more signals 02032 }//if 02033 }//NdbTransaction::OpCompleteFailure()
Here is the call graph for this function:

Here is the caller graph for this function:

| int NdbTransaction::OpCompleteSuccess | ( | ) | [private] |
Definition at line 2043 of file NdbTransaction.cpp.
References CompletedFailure, ReturnFailure, setOperationErrorCodeAbort(), theCompletionStatus, theNoOfOpCompleted, theNoOfOpSent, and theReturnStatus.
Referenced by Ndb::handleReceivedSignal().
02044 { 02045 Uint32 tNoComp = theNoOfOpCompleted; 02046 Uint32 tNoSent = theNoOfOpSent; 02047 tNoComp++; 02048 theNoOfOpCompleted = tNoComp; 02049 if (tNoComp == tNoSent) { // Last operation completed 02050 return 0; 02051 } else if (tNoComp < tNoSent) { 02052 return -1; // Continue waiting for more signals 02053 } else { 02054 setOperationErrorCodeAbort(4113); // Too many operations, 02055 // stop waiting for more 02056 theCompletionStatus = NdbTransaction::CompletedFailure; 02057 theReturnStatus = NdbTransaction::ReturnFailure; 02058 return 0; 02059 }//if 02060 }//NdbTransaction::OpCompleteSuccess()
Here is the call graph for this function:

Here is the caller graph for this function:

| void NdbTransaction::OpSent | ( | ) | [inline, private] |
Definition at line 1026 of file NdbTransaction.hpp.
References theNoOfOpSent.
Referenced by NdbOperation::doSend().
01027 { 01028 theNoOfOpSent++; 01029 }
Here is the caller graph for this function:

| Uint32 NdbTransaction::ptr2int | ( | ) | [inline, private] |
Definition at line 1048 of file NdbTransaction.hpp.
References theId.
Referenced by Ndb::NDB_connect(), Ndb::NdbTamper(), and Ndb::releaseConnectToNdb().
01048 { 01049 return theId; 01050 }
Here is the caller graph for this function:

| int NdbTransaction::receiveDIHNDBTAMPER | ( | NdbApiSignal * | anApiSignal | ) | [private] |
Definition at line 1458 of file NdbTransaction.cpp.
References Connected, Connecting, NdbApiSignal::readData(), Ndb::RestartGCI(), theNdb, and theStatus.
Referenced by Ndb::handleReceivedSignal().
01459 { 01460 if (theStatus != Connecting) { 01461 return -1; 01462 } else { 01463 theNdb->RestartGCI((Uint32)aSignal->readData(2)); 01464 theStatus = Connected; 01465 }//if 01466 return 0; 01467 }//NdbTransaction::receiveDIHNDBTAMPER()
Here is the call graph for this function:

Here is the caller graph for this function:

| int NdbTransaction::receiveSCAN_TABCONF | ( | NdbApiSignal * | , | |
| const Uint32 * | , | |||
| Uint32 | len | |||
| ) | [private] |
Definition at line 84 of file NdbTransactionScan.cpp.
References abort(), assert, CAST_CONSTPTR, NdbReceiver::checkMagicNumber(), checkState_TransId(), NdbScanOperation::execCLOSE_SCAN_REP(), NdbReceiver::execSCANOPCONF(), NdbApiSignal::getDataPtr(), ScanTabConf::getLength(), ScanTabConf::getRows(), info, Ndb::int2void(), NdbScanOperation::receiver_completed(), NdbScanOperation::receiver_delivered(), ScanTabConf::requestInfo, RNIL, theNdb, theScanningOp, ScanTabConf::transId1, and Ndb::void2rec().
Referenced by Ndb::handleReceivedSignal().
00086 { 00087 const ScanTabConf * conf = CAST_CONSTPTR(ScanTabConf, aSignal->getDataPtr()); 00088 if(checkState_TransId(&conf->transId1)){ 00089 00090 if (conf->requestInfo == ScanTabConf::EndOfData) { 00091 theScanningOp->execCLOSE_SCAN_REP(); 00092 return 0; 00093 } 00094 00095 for(Uint32 i = 0; i<len; i += 3){ 00096 Uint32 opCount, totalLen; 00097 Uint32 ptrI = * ops++; 00098 Uint32 tcPtrI = * ops++; 00099 Uint32 info = * ops++; 00100 opCount = ScanTabConf::getRows(info); 00101 totalLen = ScanTabConf::getLength(info); 00102 00103 void * tPtr = theNdb->int2void(ptrI); 00104 assert(tPtr); // For now 00105 NdbReceiver* tOp = theNdb->void2rec(tPtr); 00106 if (tOp && tOp->checkMagicNumber()) 00107 { 00108 if (tcPtrI == RNIL && opCount == 0) 00109 theScanningOp->receiver_completed(tOp); 00110 else if (tOp->execSCANOPCONF(tcPtrI, totalLen, opCount)) 00111 theScanningOp->receiver_delivered(tOp); 00112 } 00113 } 00114 return 0; 00115 } else { 00116 #ifdef NDB_NO_DROPPED_SIGNAL 00117 abort(); 00118 #endif 00119 } 00120 00121 return -1; 00122 }
Here is the call graph for this function:

Here is the caller graph for this function:

| int NdbTransaction::receiveSCAN_TABREF | ( | NdbApiSignal * | ) | [private] |
Definition at line 43 of file NdbTransactionScan.cpp.
References abort(), CAST_CONSTPTR, checkState_TransId(), ScanTabRef::closeNeeded, ScanTabRef::errorCode, NdbScanOperation::execCLOSE_SCAN_REP(), NdbApiSignal::getDataPtr(), NdbScanOperation::m_conf_receivers, NdbScanOperation::m_conf_receivers_count, NdbScanOperation::m_receivers, NdbReceiver::m_tcPtrI, NdbScanOperation::setErrorCode(), theScanningOp, and ScanTabRef::transId1.
Referenced by Ndb::handleReceivedSignal().
00043 { 00044 const ScanTabRef * ref = CAST_CONSTPTR(ScanTabRef, aSignal->getDataPtr()); 00045 00046 if(checkState_TransId(&ref->transId1)){ 00047 theScanningOp->setErrorCode(ref->errorCode); 00048 theScanningOp->execCLOSE_SCAN_REP(); 00049 if(!ref->closeNeeded){ 00050 return 0; 00051 } 00052 00057 theScanningOp->m_conf_receivers_count++; 00058 theScanningOp->m_conf_receivers[0] = theScanningOp->m_receivers[0]; 00059 theScanningOp->m_conf_receivers[0]->m_tcPtrI = ~0; 00060 return 0; 00061 } else { 00062 #ifdef NDB_NO_DROPPED_SIGNAL 00063 abort(); 00064 #endif 00065 } 00066 00067 return -1; 00068 }
Here is the call graph for this function:

Here is the caller graph for this function:

| int NdbTransaction::receiveTC_COMMITCONF | ( | const class TcCommitConf * | ) | [private] |
| int NdbTransaction::receiveTC_COMMITREF | ( | NdbApiSignal * | anApiSignal | ) | [private] |
Definition at line 1594 of file NdbTransaction.cpp.
References abort(), Aborted, CAST_CONSTPTR, checkState_TransId(), CompletedFailure, TcCommitRef::errorCode, NdbApiSignal::getDataPtr(), ReturnFailure, setOperationErrorCodeAbort(), theCommitStatus, theCompletionStatus, theReturnStatus, and TcCommitRef::transId1.
Referenced by Ndb::handleReceivedSignal().
01595 { 01596 const TcCommitRef * ref = CAST_CONSTPTR(TcCommitRef, aSignal->getDataPtr()); 01597 if(checkState_TransId(&ref->transId1)){ 01598 setOperationErrorCodeAbort(ref->errorCode); 01599 theCommitStatus = Aborted; 01600 theCompletionStatus = CompletedFailure; 01601 theReturnStatus = ReturnFailure; 01602 return 0; 01603 } else { 01604 #ifdef NDB_NO_DROPPED_SIGNAL 01605 abort(); 01606 #endif 01607 } 01608 01609 return -1; 01610 }//NdbTransaction::receiveTC_COMMITREF()
Here is the call graph for this function:

Here is the caller graph for this function:

| int NdbTransaction::receiveTCINDXCONF | ( | const class TcIndxConf * | , | |
| Uint32 | aDataLength | |||
| ) | [private] |
| int NdbTransaction::receiveTCINDXREF | ( | NdbApiSignal * | ) | [private] |
Definition at line 1969 of file NdbTransaction.cpp.
References abort(), Aborted, checkState_TransId(), NdbError::code, CompletedFailure, NdbApiSignal::getDataPtr(), NdbApiSignal::readData(), ReturnFailure, theCommitStatus, theCompletionStatus, theError, and theReturnStatus.
01970 { 01971 if(checkState_TransId(aSignal->getDataPtr()+1)){ 01972 theError.code = aSignal->readData(4); // Override any previous errors 01973 01974 /**********************************************************************/ 01975 /* A serious error has occured. This could be due to deadlock or */ 01976 /* lack of resources or simply a programming error in NDB. This */ 01977 /* transaction will be aborted. Actually it has already been */ 01978 /* and we only need to report completion and return with the */ 01979 /* error code to the application. */ 01980 /**********************************************************************/ 01981 theCompletionStatus = NdbTransaction::CompletedFailure; 01982 theCommitStatus = NdbTransaction::Aborted; 01983 theReturnStatus = NdbTransaction::ReturnFailure; 01984 return 0; 01985 } else { 01986 #ifdef NDB_NO_DROPPED_SIGNAL 01987 abort(); 01988 #endif 01989 } 01990 01991 return -1; 01992 }//NdbTransaction::receiveTCINDXREF()
Here is the call graph for this function:

| int NdbTransaction::receiveTCKEY_FAILCONF | ( | const class TcKeyFailConf * | ) | [private] |
| int NdbTransaction::receiveTCKEY_FAILREF | ( | NdbApiSignal * | anApiSignal | ) | [private] |
Definition at line 1862 of file NdbTransaction.cpp.
References Aborted, checkState_TransId(), NdbError::code, CompletedFailure, CompletedSuccess, NdbApiSignal::getDataPtr(), ndbout_c(), ReturnFailure, sendTC_ROLLBACK, theCommitStatus, theCompletionStatus, theError, theReleaseOnClose, theReturnStatus, and theSendStatus.
Referenced by Ndb::handleReceivedSignal().
01863 { 01864 /* 01865 Check that we are expecting signals from this transaction and 01866 that it doesn't belong to a transaction already 01867 completed. Simply ignore messages from other transactions. 01868 */ 01869 if(checkState_TransId(aSignal->getDataPtr()+1)){ 01870 /* 01871 We received an indication of that this transaction was aborted due to a 01872 node failure. 01873 */ 01874 if (theSendStatus == NdbTransaction::sendTC_ROLLBACK) { 01875 /* 01876 We were in the process of sending a rollback anyways. We will 01877 report it as a success. 01878 */ 01879 theCompletionStatus = NdbTransaction::CompletedSuccess; 01880 } else { 01881 theReturnStatus = NdbTransaction::ReturnFailure; 01882 theCompletionStatus = NdbTransaction::CompletedFailure; 01883 theError.code = 4031; 01884 }//if 01885 theReleaseOnClose = true; 01886 theCommitStatus = NdbTransaction::Aborted; 01887 return 0; 01888 } else { 01889 #ifdef VM_TRACE 01890 ndbout_c("Recevied TCKEY_FAILREF wo/ operation"); 01891 #endif 01892 } 01893 return -1; 01894 }//NdbTransaction::receiveTCKEY_FAILREF()
Here is the call graph for this function:

Here is the caller graph for this function:

| int NdbTransaction::receiveTCRELEASECONF | ( | NdbApiSignal * | anApiSignal | ) | [private] |
Definition at line 1526 of file NdbTransaction.cpp.
References DisConnecting, NotConnected, and theStatus.
Referenced by Ndb::handleReceivedSignal().
01527 { 01528 if (theStatus != DisConnecting) 01529 { 01530 return -1; 01531 } else 01532 { 01533 theStatus = NotConnected; 01534 } 01535 return 0; 01536 }//NdbTransaction::receiveTCRELEASECONF()
Here is the caller graph for this function:

| int NdbTransaction::receiveTCRELEASEREF | ( | NdbApiSignal * | anApiSignal | ) | [private] |
Definition at line 1547 of file NdbTransaction.cpp.
References NdbError::code, ConnectFailure, DisConnecting, NdbApiSignal::readData(), Ndb::theError, theNdb, and theStatus.
Referenced by Ndb::handleReceivedSignal().
01548 { 01549 if (theStatus != DisConnecting) { 01550 return -1; 01551 } else { 01552 theStatus = ConnectFailure; 01553 theNdb->theError.code = aSignal->readData(2); 01554 return 0; 01555 }//if 01556 }//NdbTransaction::receiveTCRELEASEREF()
Here is the call graph for this function:

Here is the caller graph for this function:

| int NdbTransaction::receiveTCROLLBACKCONF | ( | NdbApiSignal * | anApiSignal | ) | [private] |
Definition at line 1621 of file NdbTransaction.cpp.
References abort(), Aborted, checkState_TransId(), CompletedSuccess, NdbApiSignal::getDataPtr(), theCommitStatus, and theCompletionStatus.
Referenced by Ndb::handleReceivedSignal().
01622 { 01623 if(checkState_TransId(aSignal->getDataPtr() + 1)){ 01624 theCommitStatus = Aborted; 01625 theCompletionStatus = CompletedSuccess; 01626 return 0; 01627 } else { 01628 #ifdef NDB_NO_DROPPED_SIGNAL 01629 abort(); 01630 #endif 01631 } 01632 01633 return -1; 01634 }//NdbTransaction::receiveTCROLLBACKCONF()
Here is the call graph for this function:

Here is the caller graph for this function:

| int NdbTransaction::receiveTCROLLBACKREF | ( | NdbApiSignal * | anApiSignal | ) | [private] |
Definition at line 1645 of file NdbTransaction.cpp.
References abort(), Aborted, checkState_TransId(), CompletedFailure, NdbApiSignal::getDataPtr(), NdbApiSignal::readData(), ReturnFailure, setOperationErrorCodeAbort(), theCommitStatus, theCompletionStatus, and theReturnStatus.
Referenced by Ndb::handleReceivedSignal().
01646 { 01647 if(checkState_TransId(aSignal->getDataPtr() + 1)){ 01648 setOperationErrorCodeAbort(aSignal->readData(4)); 01649 theCommitStatus = Aborted; 01650 theCompletionStatus = CompletedFailure; 01651 theReturnStatus = ReturnFailure; 01652 return 0; 01653 } else { 01654 #ifdef NDB_NO_DROPPED_SIGNAL 01655 abort(); 01656 #endif 01657 } 01658 01659 return -1; 01660 }//NdbTransaction::receiveTCROLLBACKREF()
Here is the call graph for this function:

Here is the caller graph for this function:

| int NdbTransaction::receiveTCROLLBACKREP | ( | NdbApiSignal * | anApiSignal | ) | [private] |
Definition at line 1672 of file NdbTransaction.cpp.
References abort(), Aborted, checkState_TransId(), NdbError::code, CompletedFailure, NdbApiSignal::getDataPtr(), NdbApiSignal::readData(), ReturnFailure, theCommitStatus, theCompletionStatus, theError, and theReturnStatus.
Referenced by Ndb::handleReceivedSignal().
01673 { 01674 /**************************************************************************** 01675 Check that we are expecting signals from this transaction and that it doesn't 01676 belong to a transaction already completed. Simply ignore messages from other 01677 transactions. 01678 ****************************************************************************/ 01679 if(checkState_TransId(aSignal->getDataPtr() + 1)){ 01680 theError.code = aSignal->readData(4);// Override any previous errors 01681 01682 /**********************************************************************/ 01683 /* A serious error has occured. This could be due to deadlock or */ 01684 /* lack of resources or simply a programming error in NDB. This */ 01685 /* transaction will be aborted. Actually it has already been */ 01686 /* and we only need to report completion and return with the */ 01687 /* error code to the application. */ 01688 /**********************************************************************/ 01689 theCompletionStatus = CompletedFailure; 01690 theCommitStatus = Aborted; 01691 theReturnStatus = ReturnFailure; 01692 return 0; 01693 } else { 01694 #ifdef NDB_NO_DROPPED_SIGNAL 01695 abort(); 01696 #endif 01697 } 01698 01699 return -1; 01700 }//NdbTransaction::receiveTCROLLBACKREP()
Here is the call graph for this function:

Here is the caller graph for this function:

| int NdbTransaction::receiveTCSEIZECONF | ( | NdbApiSignal * | anApiSignal | ) | [private] |
Definition at line 1478 of file NdbTransaction.cpp.
References Connected, Connecting, NdbApiSignal::readData(), theStatus, and theTCConPtr.
Referenced by Ndb::handleReceivedSignal().
01479 { 01480 if (theStatus != Connecting) 01481 { 01482 return -1; 01483 } else 01484 { 01485 theTCConPtr = (Uint32)aSignal->readData(2); 01486 theStatus = Connected; 01487 } 01488 return 0; 01489 }//NdbTransaction::receiveTCSEIZECONF()
Here is the call graph for this function:

Here is the caller graph for this function:

| int NdbTransaction::receiveTCSEIZEREF | ( | NdbApiSignal * | anApiSignal | ) | [private] |
Definition at line 1500 of file NdbTransaction.cpp.
References NdbError::code, ConnectFailure, Connecting, DBUG_ENTER, DBUG_PRINT, DBUG_RETURN, Ndb::getNdbError(), NdbError::message, NdbApiSignal::readData(), Ndb::theError, theNdb, and theStatus.
Referenced by Ndb::handleReceivedSignal().
01501 { 01502 DBUG_ENTER("NdbTransaction::receiveTCSEIZEREF"); 01503 if (theStatus != Connecting) 01504 { 01505 DBUG_RETURN(-1); 01506 } else 01507 { 01508 theStatus = ConnectFailure; 01509 theNdb->theError.code = aSignal->readData(2); 01510 DBUG_PRINT("info",("error code %d, %s", 01511 theNdb->getNdbError().code, 01512 theNdb->getNdbError().message)); 01513 DBUG_RETURN(0); 01514 } 01515 }//NdbTransaction::receiveTCSEIZEREF()
Here is the call graph for this function:

Here is the caller graph for this function:

| 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.
Definition at line 675 of file NdbTransaction.cpp.
References sendTC_HBREP().
00675 { 00676 return sendTC_HBREP(); 00677 }
Here is the call graph for this function:

| void NdbTransaction::release | ( | ) | [private] |
Definition at line 890 of file NdbTransaction.cpp.
References abort(), Aborted, Committed, execute(), NotInList, releaseOperations(), Rollback, theCommitStatus, theInUseState, theListState, theMagicNumber, theNdb, and theTransactionIsStarted.
Referenced by Ndb::closeTransaction().
00890 { 00891 releaseOperations(); 00892 if ( (theTransactionIsStarted == true) && 00893 ((theCommitStatus != Committed) && 00894 (theCommitStatus != Aborted))) { 00895 /************************************************************************ 00896 * The user did not perform any rollback but simply closed the 00897 * transaction. We must rollback Ndb since Ndb have been contacted. 00898 ************************************************************************/ 00899 execute(Rollback); 00900 }//if 00901 theMagicNumber = 0xFE11DC; 00902 theInUseState = false; 00903 #ifdef VM_TRACE 00904 if (theListState != NotInList) { 00905 theNdb->printState("release %x", this); 00906 abort(); 00907 } 00908 #endif 00909 }//NdbTransaction::release()
Here is the call graph for this function:

Here is the caller graph for this function:

| void NdbTransaction::releaseCompletedOperations | ( | ) | [private] |
Release completed operations
Definition at line 950 of file NdbTransaction.cpp.
References NULL, releaseOps(), theCompletedFirstOp, and theCompletedLastOp.
Referenced by restart().
00951 { 00952 releaseOps(theCompletedFirstOp); 00953 theCompletedFirstOp = NULL; 00954 theCompletedLastOp = NULL; 00955 }//NdbTransaction::releaseOperations()
Here is the call graph for this function:

Here is the caller graph for this function:

| void NdbTransaction::releaseOperations | ( | ) | [private] |
Definition at line 927 of file NdbTransaction.cpp.
References m_firstExecutedScanOp, m_theFirstScanOperation, m_theLastScanOperation, NULL, releaseOps(), releaseScanOperations(), theCompletedFirstOp, theCompletedLastOp, theFirstExecOpInList, theFirstOpInList, theLastExecOpInList, theLastOpInList, and theScanningOp.
Referenced by release().
00928 { 00929 // Release any open scans 00930 releaseScanOperations(m_theFirstScanOperation); 00931 releaseScanOperations(m_firstExecutedScanOp); 00932 00933 releaseOps(theCompletedFirstOp); 00934 releaseOps(theFirstOpInList); 00935 releaseOps(theFirstExecOpInList); 00936 00937 theCompletedFirstOp = NULL; 00938 theCompletedLastOp = NULL; 00939 theFirstOpInList = NULL; 00940 theFirstExecOpInList = NULL; 00941 theLastOpInList = NULL; 00942 theLastExecOpInList = NULL; 00943 theScanningOp = NULL; 00944 m_theFirstScanOperation = NULL; 00945 m_theLastScanOperation = NULL; 00946 m_firstExecutedScanOp = NULL; 00947 }//NdbTransaction::releaseOperations()
Here is the call graph for this function:

Here is the caller graph for this function:

| void NdbTransaction::releaseOps | ( | NdbOperation * | ) | [private] |
Definition at line 912 of file NdbTransaction.cpp.
References NdbOperation::next(), NULL, NdbOperation::release(), Ndb::releaseOperation(), and theNdb.
Referenced by releaseCompletedOperations(), and releaseOperations().
00912 { 00913 while (tOp != NULL) { 00914 NdbOperation* tmp = tOp; 00915 tOp->release(); 00916 tOp = tOp->next(); 00917 theNdb->releaseOperation(tmp); 00918 }//while 00919 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void NdbTransaction::releaseScanOperation | ( | NdbIndexScanOperation * | ) | [private] |
Definition at line 980 of file NdbTransaction.cpp.
References DBUG_ENTER, DBUG_PRINT, DBUG_VOID_RETURN, m_firstExecutedScanOp, m_theFirstScanOperation, NULL, NdbOperation::release(), Ndb::releaseScanOperation(), theNdb, and NdbOperation::theNext.
Referenced by NdbScanOperation::close().
00981 { 00982 DBUG_ENTER("NdbTransaction::releaseScanOperation"); 00983 DBUG_PRINT("enter", ("this=0x%x op=0x%x", (UintPtr)this, (UintPtr)cursorOp)); 00984 00985 // here is one reason to make op lists doubly linked 00986 if (cursorOp->m_executed) 00987 { 00988 if (m_firstExecutedScanOp == cursorOp) { 00989 m_firstExecutedScanOp = (NdbIndexScanOperation*)cursorOp->theNext; 00990 cursorOp->release(); 00991 theNdb->releaseScanOperation(cursorOp); 00992 } else if (m_firstExecutedScanOp != NULL) { 00993 NdbIndexScanOperation* tOp = m_firstExecutedScanOp; 00994 while (tOp->theNext != NULL) { 00995 if (tOp->theNext == cursorOp) { 00996 tOp->theNext = cursorOp->theNext; 00997 cursorOp->release(); 00998 theNdb->releaseScanOperation(cursorOp); 00999 break; 01000 } 01001 tOp = (NdbIndexScanOperation*)tOp->theNext; 01002 } 01003 } 01004 } 01005 else 01006 { 01007 if (m_theFirstScanOperation == cursorOp) { 01008 m_theFirstScanOperation = (NdbIndexScanOperation*)cursorOp->theNext; 01009 cursorOp->release(); 01010 theNdb->releaseScanOperation(cursorOp); 01011 } else if (m_theFirstScanOperation != NULL) { 01012 NdbIndexScanOperation* tOp = m_theFirstScanOperation; 01013 while (tOp->theNext != NULL) { 01014 if (tOp->theNext == cursorOp) { 01015 tOp->theNext = cursorOp->theNext; 01016 cursorOp->release(); 01017 theNdb->releaseScanOperation(cursorOp); 01018 break; 01019 } 01020 tOp = (NdbIndexScanOperation*)tOp->theNext; 01021 } 01022 } 01023 } 01024 DBUG_VOID_RETURN; 01025 }//NdbTransaction::releaseScanOperation()
Here is the call graph for this function:

Here is the caller graph for this function:

| void NdbTransaction::releaseScanOperations | ( | NdbIndexScanOperation * | ) | [private] |
Definition at line 964 of file NdbTransaction.cpp.
References NdbOperation::next(), next(), NdbScanOperation::release(), Ndb::releaseScanOperation(), and theNdb.
Referenced by releaseOperations().
00965 { 00966 while(cursorOp != 0){ 00967 NdbIndexScanOperation* next = (NdbIndexScanOperation*)cursorOp->next(); 00968 cursorOp->release(); 00969 theNdb->releaseScanOperation(cursorOp); 00970 cursorOp = next; 00971 } 00972 }//NdbTransaction::releaseScanOperations()
Here is the call graph for this function:

Here is the caller graph for this function:

| void NdbTransaction::remove_list | ( | NdbOperation *& | head, | |
| NdbOperation * | ||||
| ) | [private] |
Definition at line 1275 of file NdbTransaction.cpp.
References list(), NdbOperation::next(), and NULL.
Referenced by NdbIndexScanOperation::reset_bounds().
01275 { 01276 NdbOperation* tmp= list; 01277 if(tmp == op) 01278 list = op->next(); 01279 else { 01280 while(tmp && tmp->next() != op) tmp = tmp->next(); 01281 if(tmp) 01282 tmp->next(op->next()); 01283 } 01284 op->next(NULL); 01285 }
Here is the call graph for this function:

Here is the caller graph for this function:

| int NdbTransaction::report_node_failure | ( | Uint32 | id | ) | [private] |
Definition at line 2168 of file NdbTransaction.cpp.
References NdbError::code, CompletedFailure, count, BitmaskPOD< size >::get(), m_db_nodes, NdbReceiver::m_expected_result_length, m_failed_db_nodes, NdbReceiver::m_received_result_length, NdbOperation::next(), ReturnFailure, BitmaskPOD< size >::set(), theCompletionStatus, theError, NdbOperation::theError, theFirstExecOpInList, theNoOfOpCompleted, theNoOfOpSent, NdbOperation::theReceiver, and theReturnStatus.
02168 { 02169 NdbNodeBitmask::set(m_failed_db_nodes, id); 02170 if(!NdbNodeBitmask::get(m_db_nodes, id)) 02171 { 02172 return 0; 02173 } 02174 02183 NdbOperation* tmp = theFirstExecOpInList; 02184 const Uint32 len = TcKeyConf::SimpleReadBit | id; 02185 Uint32 tNoComp = theNoOfOpCompleted; 02186 Uint32 tNoSent = theNoOfOpSent; 02187 Uint32 count = 0; 02188 while(tmp != 0) 02189 { 02190 if(tmp->theReceiver.m_expected_result_length == len && 02191 tmp->theReceiver.m_received_result_length == 0) 02192 { 02193 count++; 02194 tmp->theError.code = 4119; 02195 } 02196 tmp = tmp->next(); 02197 } 02198 tNoComp += count; 02199 theNoOfOpCompleted = tNoComp; 02200 if(count) 02201 { 02202 theReturnStatus = NdbTransaction::ReturnFailure; 02203 if(tNoComp == tNoSent) 02204 { 02205 theError.code = 4119; 02206 theCompletionStatus = NdbTransaction::CompletedFailure; 02207 return 1; 02208 } 02209 } 02210 return 0; 02211 }
Here is the call graph for this function:

| int NdbTransaction::restart | ( | ) |
Restart transaction
Once a transaction has been completed successfully it can be started again wo/ calling closeTransaction/startTransaction
This method does not close open scans, c.f. NdbScanOperation::close()
This method can only be called _directly_ after commit and only if commit is successful
Definition at line 210 of file NdbTransaction.cpp.
References CompletedSuccess, DBUG_ENTER, DBUG_PRINT, DBUG_RETURN, NotCompleted, releaseCompletedOperations(), Started, theCommitStatus, theCompletionStatus, Ndb::theFirstTransId, theNdb, theTransactionId, and theTransactionIsStarted.
Referenced by clear_table(), and scan_delete().
00210 { 00211 DBUG_ENTER("NdbTransaction::restart"); 00212 if(theCompletionStatus == CompletedSuccess){ 00213 releaseCompletedOperations(); 00214 Uint64 tTransid = theNdb->theFirstTransId; 00215 theTransactionId = tTransid; 00216 if ((tTransid & 0xFFFFFFFF) == 0xFFFFFFFF) { 00217 theNdb->theFirstTransId = (tTransid >> 32) << 32; 00218 } else { 00219 theNdb->theFirstTransId = tTransid + 1; 00220 } 00221 theCommitStatus = Started; 00222 theCompletionStatus = NotCompleted; 00223 theTransactionIsStarted = false; 00224 DBUG_RETURN(0); 00225 } 00226 DBUG_PRINT("error",("theCompletionStatus != CompletedSuccess")); 00227 DBUG_RETURN(-1); 00228 }
Here is the call graph for this function:

Here is the caller graph for this function:

| int NdbTransaction::sendCOMMIT | ( | ) | [private] |
Definition at line 860 of file NdbTransaction.cpp.
References GSN_TC_COMMITREQ, Ndb::insert_sent_list(), NdbImpl::m_transporter_facade, TransporterFacade::sendSignal(), sendTC_COMMIT, NdbApiSignal::setData(), NdbApiSignal::setSignal(), theDBnode, Ndb::theImpl, Ndb::theMyRef, theNdb, theSendStatus, theTCConPtr, and theTransactionId.
Referenced by doSend().
00861 { 00862 NdbApiSignal tSignal(theNdb->theMyRef); 00863 Uint32 tTransId1, tTransId2; 00864 TransporterFacade *tp = theNdb->theImpl->m_transporter_facade; 00865 int tReturnCode; 00866 00867 tTransId1 = (Uint32) theTransactionId; 00868 tTransId2 = (Uint32) (theTransactionId >> 32); 00869 tSignal.setSignal(GSN_TC_COMMITREQ); 00870 tSignal.setData(theTCConPtr, 1); 00871 tSignal.setData(tTransId1, 2); 00872 tSignal.setData(tTransId2, 3); 00873 00874 tReturnCode = tp->sendSignal(&tSignal,theDBnode); 00875 if (tReturnCode != -1) { 00876 theSendStatus = sendTC_COMMIT; 00877 theNdb->insert_sent_list(this); 00878 return 0; 00879 } else { 00880 return -1; 00881 }//if 00882 }//NdbTransaction::sendCOMMIT()
Here is the call graph for this function:

Here is the caller graph for this function:

| int NdbTransaction::sendROLLBACK | ( | ) | [private] |
Definition at line 805 of file NdbTransaction.cpp.
References Aborted, Committed, GSN_TCROLLBACKREQ, Ndb::insert_completed_list(), Ndb::insert_sent_list(), NdbImpl::m_transporter_facade, sendCompleted, TransporterFacade::sendSignal(), sendTC_ROLLBACK, NdbApiSignal::setData(), NdbApiSignal::setSignal(), theCommitStatus, theDBnode, Ndb::theImpl, Ndb::theMyRef, theNdb, theSendStatus, theTCConPtr, theTransactionId, and theTransactionIsStarted.
Referenced by doSend().
00806 { 00807 Ndb* tNdb = theNdb; 00808 if ((theTransactionIsStarted == true) && 00809 (theCommitStatus != Committed) && 00810 (theCommitStatus != Aborted)) { 00811 /************************************************************************** 00812 * The user did not perform any rollback but simply closed the 00813 * transaction. We must rollback Ndb since Ndb have been contacted. 00814 *************************************************************************/ 00815 NdbApiSignal tSignal(tNdb->theMyRef); 00816 Uint32 tTransId1, tTransId2; 00817 TransporterFacade *tp = theNdb->theImpl->m_transporter_facade; 00818 int tReturnCode; 00819 00820 tTransId1 = (Uint32) theTransactionId; 00821 tTransId2 = (Uint32) (theTransactionId >> 32); 00822 tSignal.setSignal(GSN_TCROLLBACKREQ); 00823 tSignal.setData(theTCConPtr, 1); 00824 tSignal.setData(tTransId1, 2); 00825 tSignal.setData(tTransId2, 3); 00826 tReturnCode = tp->sendSignal(&tSignal,theDBnode); 00827 if (tReturnCode != -1) { 00828 theSendStatus = sendTC_ROLLBACK; 00829 tNdb->insert_sent_list(this); 00830 return 0; 00831 }//if 00832 /********************************************************************* 00833 * It was not possible to abort the transaction towards the NDB kernel 00834 * and thus we put it into the array of completed transactions that 00835 * are ready for reporting to the application. 00836 *********************************************************************/ 00837 return -1; 00838 } else { 00839 /* 00840 It is not necessary to abort the transaction towards the NDB kernel and 00841 thus we put it into the array of completed transactions that are ready 00842 for reporting to the application. 00843 */ 00844 theSendStatus = sendCompleted; 00845 tNdb->insert_completed_list(this); 00846 return 0; 00847 ; 00848 }//if 00849 }//NdbTransaction::sendROLLBACK()
Here is the call graph for this function:

Here is the caller graph for this function:

| void NdbTransaction::sendTC_COMMIT_ACK | ( | class TransporterFacade * | , | |
| NdbApiSignal * | , | |||
| Uint32 | transId1, | |||
| Uint32 | transId2, | |||
| Uint32 | aBlockRef | |||
| ) | [static, private] |
Definition at line 1431 of file Ndbif.cpp.
References DBTC, NdbApiSignal::getDataPtrSend(), GSN_TC_COMMIT_ACK, ndbout_c(), refToNode(), TransporterFacade::sendSignalUnCond(), SignalHeader::theLength, SignalHeader::theReceiversBlockNumber, SignalHeader::theTrace, SignalHeader::theVerId_signalNumber, and TestOrd::TraceAPI.
Referenced by Ndb::handleReceivedSignal().
01434 { 01435 #ifdef MARKER_TRACE 01436 ndbout_c("Sending TC_COMMIT_ACK(0x%.8x, 0x%.8x) to -> %d", 01437 transId1, 01438 transId2, 01439 refToNode(aTCRef)); 01440 #endif 01441 aSignal->theTrace = TestOrd::TraceAPI; 01442 aSignal->theReceiversBlockNumber = DBTC; 01443 aSignal->theVerId_signalNumber = GSN_TC_COMMIT_ACK; 01444 aSignal->theLength = 2; 01445 01446 Uint32 * dataPtr = aSignal->getDataPtrSend(); 01447 dataPtr[0] = transId1; 01448 dataPtr[1] = transId2; 01449 tp->sendSignalUnCond(aSignal, refToNode(aTCRef)); 01450 }
Here is the call graph for this function:

Here is the caller graph for this function:

| int NdbTransaction::sendTC_HBREP | ( | ) | [private] |
Definition at line 687 of file NdbTransaction.cpp.
References TcHbRep::apiConnectPtr, CAST_PTR, NdbApiSignal::getDataPtrSend(), Ndb::getSignal(), GSN_TC_HBREP, TransporterFacade::lock_mutex(), NdbImpl::m_transporter_facade, NULL, Ndb::releaseSignal(), TransporterFacade::sendSignal(), NdbApiSignal::setSignal(), theDBnode, Ndb::theImpl, theNdb, theTCConPtr, theTransactionId, TcHbRep::transId1, TcHbRep::transId2, and TransporterFacade::unlock_mutex().
Referenced by refresh().
00688 { 00689 NdbApiSignal* tSignal; 00690 Ndb* tNdb = theNdb; 00691 Uint32 tTransId1, tTransId2; 00692 00693 tSignal = tNdb->getSignal(); 00694 if (tSignal == NULL) { 00695 return -1; 00696 } 00697 00698 if (tSignal->setSignal(GSN_TC_HBREP) == -1) { 00699 return -1; 00700 } 00701 00702 TcHbRep * const tcHbRep = CAST_PTR(TcHbRep, tSignal->getDataPtrSend()); 00703 00704 tcHbRep->apiConnectPtr = theTCConPtr; 00705 00706 tTransId1 = (Uint32) theTransactionId; 00707 tTransId2 = (Uint32) (theTransactionId >> 32); 00708 tcHbRep->transId1 = tTransId1; 00709 tcHbRep->transId2 = tTransId2; 00710 00711 TransporterFacade *tp = theNdb->theImpl->m_transporter_facade; 00712 tp->lock_mutex(); 00713 const int res = tp->sendSignal(tSignal,theDBnode); 00714 tp->unlock_mutex(); 00715 tNdb->releaseSignal(tSignal); 00716 00717 if (res == -1){ 00718 return -1; 00719 } 00720 00721 return 0; 00722 }//NdbTransaction::sendTC_HBREP()
Here is the call graph for this function:

Here is the caller graph for this function:

| void NdbTransaction::set_send_size | ( | Uint32 | ) | [inline, private] |
| void NdbTransaction::setBuddyConPtr | ( | Uint32 | ) | [inline, private] |
Definition at line 929 of file NdbTransaction.hpp.
References theBuddyConPtr.
Referenced by Ndb::hupp().
00930 { 00931 theBuddyConPtr = aBuddyConPtr; 00932 }
Here is the caller graph for this function:

Set Connected node id and sequence no
Definition at line 872 of file NdbTransaction.hpp.
References theDBnode, and theNodeSequence.
Referenced by Ndb::NDB_connect().
00873 { 00874 theDBnode = aNode; 00875 theNodeSequence = aSequenceNo; 00876 }
Here is the caller graph for this function:

| void NdbTransaction::setErrorCode | ( | int | anErrorCode | ) | [private] |
Definition at line 198 of file NdbTransaction.cpp.
References NdbError::code, DBUG_ENTER, DBUG_PRINT, DBUG_VOID_RETURN, and theError.
Referenced by executeAsynchPrepare(), getNdbOperation(), setOperationErrorCode(), and setOperationErrorCodeAbort().
00199 { 00200 DBUG_ENTER("NdbTransaction::setErrorCode"); 00201 DBUG_PRINT("enter", ("error: %d, theError.code: %d", error, theError.code)); 00202 00203 if (theError.code == 0) 00204 theError.code = error; 00205 00206 DBUG_VOID_RETURN; 00207 }//NdbTransaction::setErrorCode()
Here is the caller graph for this function:

| void NdbTransaction::setGCI | ( | int | GCI | ) | [inline, private] |
Definition at line 1014 of file NdbTransaction.hpp.
References theGlobalCheckpointId.
01015 { 01016 theGlobalCheckpointId = aGlobalCheckpointId; 01017 }
| void NdbTransaction::setMyBlockReference | ( | int | ) | [inline, private] |
Definition at line 897 of file NdbTransaction.hpp.
References theMyRef.
Referenced by Ndb::NDB_connect().
00898 { 00899 theMyRef = aBlockRef; 00900 }
Here is the caller graph for this function:

| void NdbTransaction::setOperationErrorCode | ( | int | anErrorCode | ) | [private] |
Definition at line 162 of file NdbTransaction.cpp.
References DBUG_ENTER, DBUG_VOID_RETURN, and setErrorCode().
Referenced by NdbOperation::setErrorCode().
00163 { 00164 DBUG_ENTER("NdbTransaction::setOperationErrorCode"); 00165 setErrorCode(error); 00166 DBUG_VOID_RETURN; 00167 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void NdbTransaction::setOperationErrorCodeAbort | ( | int | anErrorCode, | |
| int | abortOption = -1 | |||
| ) | [private] |
Definition at line 176 of file NdbTransaction.cpp.
References Aborted, AbortOnError, Committed, DBUG_ENTER, DBUG_VOID_RETURN, m_abortOption, NeedAbort, setErrorCode(), theCommitStatus, and theTransactionIsStarted.
Referenced by doSend(), executeNoBlobs(), getNdbIndexOperation(), getNdbIndexScanOperation(), getNdbOperation(), getNdbScanOperation(), OpCompleteFailure(), OpCompleteSuccess(), receiveTC_COMMITREF(), NdbOperation::receiveTCKEYREF(), receiveTCROLLBACKREF(), and NdbOperation::setErrorCodeAbort().
00177 { 00178 DBUG_ENTER("NdbTransaction::setOperationErrorCodeAbort"); 00179 if (abortOption == -1) 00180 abortOption = m_abortOption; 00181 if (theTransactionIsStarted == false) { 00182 theCommitStatus = Aborted; 00183 } else if ((abortOption == AbortOnError) && 00184 (theCommitStatus != Committed) && 00185 (theCommitStatus != Aborted)) { 00186 theCommitStatus = NeedAbort; 00187 }//if 00188 setErrorCode(error); 00189 DBUG_VOID_RETURN; 00190 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void NdbTransaction::setTC_ConnectPtr | ( | Uint32 | ) | [inline, private] |
Definition at line 909 of file NdbTransaction.hpp.
References theTCConPtr.
00910 { 00911 theTCConPtr = aTCConPtr; 00912 }
| void NdbTransaction::setTransactionId | ( | Uint64 | aTransactionId | ) | [inline, private] |
Definition at line 865 of file NdbTransaction.hpp.
References theTransactionId.
Referenced by Ndb::hupp(), and Ndb::startTransactionLocal().
00866 { 00867 theTransactionId = aTransactionId; 00868 }
Here is the caller graph for this function:

| void NdbTransaction::Status | ( | ConStatusType | ) | [inline, private] |
Definition at line 1001 of file NdbTransaction.hpp.
References theStatus.
01002 { 01003 theStatus = aStatus; 01004 }
| NdbTransaction::ConStatusType NdbTransaction::Status | ( | ) | [inline, private] |
Definition at line 988 of file NdbTransaction.hpp.
References theStatus.
Referenced by Ndb::NDB_connect(), Ndb::NdbTamper(), and Ndb::releaseConnectToNdb().
00989 { 00990 return theStatus; 00991 }
Here is the caller graph for this function:

friend class ha_ndbcluster [friend] |
Definition at line 143 of file NdbTransaction.hpp.
friend class HugoOperations [friend] |
Definition at line 810 of file NdbTransaction.hpp.
friend class Ndb [friend] |
Definition at line 137 of file NdbTransaction.hpp.
friend struct Ndb_free_list_t< NdbTransaction > [friend] |
Definition at line 811 of file NdbTransaction.hpp.
friend class NdbBlob [friend] |
Definition at line 142 of file NdbTransaction.hpp.
friend class NdbIndexOperation [friend] |
Definition at line 140 of file NdbTransaction.hpp.
friend class NdbIndexScanOperation [friend] |
Definition at line 141 of file NdbTransaction.hpp.
friend class NdbOperation [friend] |
Definition at line 138 of file NdbTransaction.hpp.
friend class NdbScanOperation [friend] |
Definition at line 139 of file NdbTransaction.hpp.
Uint8 NdbTransaction::m_abortOption [private] |
Definition at line 756 of file NdbTransaction.hpp.
Referenced by executeAsynchPrepare(), init(), NdbOperation::prepareSend(), NdbIndexOperation::prepareSend(), NdbOperation::receiveTCKEYREF(), and setOperationErrorCodeAbort().
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
Definition at line 776 of file NdbTransaction.hpp.
Referenced by executeAsynchPrepare(), NdbTransaction(), and report_node_failure().
Uint32 NdbTransaction::m_failed_db_nodes[2] [private] |
Definition at line 777 of file NdbTransaction.hpp.
Referenced by executeAsynchPrepare(), NdbTransaction(), and report_node_failure().
Definition at line 786 of file NdbTransaction.hpp.
Referenced by executeAsynchPrepare(), init(), releaseOperations(), releaseScanOperation(), and NdbIndexScanOperation::reset_bounds().
Definition at line 783 of file NdbTransaction.hpp.
Referenced by define_scan_op(), executeAsynchPrepare(), init(), releaseOperations(), and releaseScanOperation().
Definition at line 784 of file NdbTransaction.hpp.
Referenced by define_scan_op(), executeAsynchPrepare(), init(), and releaseOperations().
bool NdbTransaction::m_waitForReply [private] |
Definition at line 782 of file NdbTransaction.hpp.
Referenced by executeAsynchPrepare(), executeNoBlobs(), and init().
bool NdbTransaction::theBlobFlag [private] |
Definition at line 793 of file NdbTransaction.hpp.
Referenced by execute(), NdbOperation::getBlobHandle(), hasBlobOperation(), and init().
Uint32 NdbTransaction::theBuddyConPtr [private] |
Definition at line 791 of file NdbTransaction.hpp.
Referenced by getBuddyConPtr(), init(), and setBuddyConPtr().
Definition at line 708 of file NdbTransaction.hpp.
Referenced by executeAsynchPrepare(), and Ndb::reportCallback().
void* NdbTransaction::theCallbackObject [private] |
Definition at line 745 of file NdbTransaction.hpp.
Referenced by commitStatus(), doSend(), executeAsynchPrepare(), NdbScanOperation::executeCursor(), getGCI(), getNdbIndexOperation(), getNdbIndexScanOperation(), getNdbOperation(), getNdbScanOperation(), NdbOperation::incCheck(), init(), NdbOperation::initial_interpreterCheck(), NdbOperation::intermediate_interpreterCheck(), NdbOperation::labelCheck(), NdbOperation::read_attrCheck(), receiveTC_COMMITREF(), receiveTCINDXREF(), receiveTCKEY_FAILREF(), receiveTCROLLBACKCONF(), receiveTCROLLBACKREF(), receiveTCROLLBACKREP(), release(), restart(), sendROLLBACK(), setOperationErrorCodeAbort(), and NdbOperation::write_attrCheck().
NdbOperation* NdbTransaction::theCompletedFirstOp [private] |
Definition at line 728 of file NdbTransaction.hpp.
Referenced by execute(), getNextCompletedOperation(), handleExecuteCompletion(), init(), releaseCompletedOperations(), and releaseOperations().
NdbOperation* NdbTransaction::theCompletedLastOp [private] |
Definition at line 729 of file NdbTransaction.hpp.
Referenced by execute(), handleExecuteCompletion(), init(), releaseCompletedOperations(), and releaseOperations().
Uint32 NdbTransaction::theDBnode [private] |
Definition at line 765 of file NdbTransaction.hpp.
Referenced by NdbScanOperation::close_impl(), doSend(), executeAsynchPrepare(), getConnectedNodeId(), NdbIndexScanOperation::next_result_ordered(), NdbScanOperation::nextResultImpl(), NdbScanOperation::restart(), NdbScanOperation::send_next_scan(), NdbIndexScanOperation::send_next_scan_ordered(), sendCOMMIT(), sendROLLBACK(), sendTC_HBREP(), and setConnectedNodeId().
NdbError NdbTransaction::theError [private] |
Definition at line 714 of file NdbTransaction.hpp.
Referenced by Ndb::closeTransaction(), execute(), executeAsynchPrepare(), getNdbError(), init(), NdbTransaction(), Ndb::opTupleIdOnNdb(), receiveTCINDXREF(), receiveTCKEY_FAILREF(), receiveTCROLLBACKREP(), report_node_failure(), setErrorCode(), and NdbBlob::setErrorCode().
int NdbTransaction::theErrorLine [private] |
Definition at line 715 of file NdbTransaction.hpp.
Referenced by getNdbErrorLine(), init(), NdbOperation::setErrorCode(), and NdbOperation::setErrorCodeAbort().
NdbOperation* NdbTransaction::theErrorOperation [private] |
Definition at line 716 of file NdbTransaction.hpp.
Referenced by getNdbErrorOperation(), init(), NdbOperation::setErrorCode(), and NdbOperation::setErrorCodeAbort().
NdbOperation* NdbTransaction::theFirstExecOpInList [private] |
Definition at line 724 of file NdbTransaction.hpp.
Referenced by doSend(), executeAsynchPrepare(), handleExecuteCompletion(), init(), releaseOperations(), and report_node_failure().
NdbOperation* NdbTransaction::theFirstOpInList [private] |
Definition at line 721 of file NdbTransaction.hpp.
Referenced by execute(), executeAsynchPrepare(), getFirstDefinedOperation(), init(), and releaseOperations().
Uint32 NdbTransaction::theGlobalCheckpointId [private] |
Uint32 NdbTransaction::theId [private] |
Definition at line 692 of file NdbTransaction.hpp.
Referenced by NdbTransaction(), ptr2int(), and ~NdbTransaction().
bool NdbTransaction::theInUseState [private] |
NdbOperation* NdbTransaction::theLastExecOpInList [private] |
Definition at line 725 of file NdbTransaction.hpp.
Referenced by executeAsynchPrepare(), handleExecuteCompletion(), init(), and releaseOperations().
NdbOperation* NdbTransaction::theLastOpInList [private] |
Definition at line 722 of file NdbTransaction.hpp.
Referenced by execute(), executeAsynchPrepare(), getLastDefinedOperation(), init(), and releaseOperations().
enum NdbTransaction::ListState NdbTransaction::theListState [private] |
Uint32 NdbTransaction::theMagicNumber [private] |
Definition at line 746 of file NdbTransaction.hpp.
Referenced by checkMagicNumber(), Ndb::closeTransaction(), NdbScanOperation::executeCursor(), Ndb::getNdbCon(), init(), NdbScanOperation::init(), release(), Ndb::releaseConnectToNdb(), and Ndb::releaseNdbCon().
Uint32 NdbTransaction::theMyRef [private] |
Definition at line 734 of file NdbTransaction.hpp.
Referenced by Ndb::closeTransaction(), and setMyBlockReference().
Ndb* NdbTransaction::theNdb [private] |
Definition at line 718 of file NdbTransaction.hpp.
Referenced by close(), doSend(), executeAsynchPrepare(), executeNoBlobs(), getNdbIndexOperation(), getNdbIndexScanOperation(), getNdbOperation(), getNdbScanOperation(), NdbTransaction(), receiveDIHNDBTAMPER(), receiveSCAN_TABCONF(), receiveTCRELEASEREF(), receiveTCSEIZEREF(), release(), releaseOps(), releaseScanOperation(), releaseScanOperations(), restart(), sendCOMMIT(), sendROLLBACK(), sendTC_HBREP(), and ~NdbTransaction().
NdbTransaction* NdbTransaction::theNext [private] |
Definition at line 719 of file NdbTransaction.hpp.
Referenced by Ndb::closeTransaction(), Ndb::doDisconnect(), Ndb::getConnectedNdbTransaction(), init(), Ndb::NDB_connect(), and next().
Uint32 NdbTransaction::theNodeSequence [private] |
Definition at line 766 of file NdbTransaction.hpp.
Referenced by NdbScanOperation::close_impl(), NdbScanOperation::executeCursor(), NdbIndexScanOperation::next_result_ordered(), NdbScanOperation::nextResultImpl(), Ndb::releaseConnectToNdb(), and setConnectedNodeId().
Uint32 NdbTransaction::theNoOfOpCompleted [private] |
Definition at line 732 of file NdbTransaction.hpp.
Referenced by executeAsynchPrepare(), OpCompleteFailure(), OpCompleteSuccess(), and report_node_failure().
Uint32 NdbTransaction::theNoOfOpFetched [private] |
Definition at line 733 of file NdbTransaction.hpp.
Uint32 NdbTransaction::theNoOfOpSent [private] |
Definition at line 731 of file NdbTransaction.hpp.
Referenced by executeAsynchPrepare(), OpCompleteFailure(), OpCompleteSuccess(), OpSent(), and report_node_failure().
Uint8 NdbTransaction::thePendingBlobOps [private] |
Definition at line 794 of file NdbTransaction.hpp.
Referenced by NdbBlob::deleteParts(), executeNoBlobs(), executePendingBlobOps(), NdbBlob::executePendingBlobReads(), NdbBlob::executePendingBlobWrites(), init(), NdbBlob::insertParts(), NdbBlob::readTableParts(), and NdbBlob::updateParts().
Uint32 NdbTransaction::thePriority [private] |
bool NdbTransaction::theReleaseOnClose [private] |
Definition at line 767 of file NdbTransaction.hpp.
Referenced by NdbScanOperation::close_impl(), Ndb::closeTransaction(), doSend(), NdbScanOperation::executeCursor(), init(), NdbScanOperation::nextResultImpl(), and receiveTCKEY_FAILREF().
ReturnType NdbTransaction::theReturnStatus [private] |
Definition at line 751 of file NdbTransaction.hpp.
Referenced by doSend(), executeAsynchPrepare(), executeNoBlobs(), OpCompleteSuccess(), receiveTC_COMMITREF(), receiveTCINDXREF(), receiveTCKEY_FAILREF(), NdbOperation::receiveTCKEYREF(), receiveTCROLLBACKREF(), receiveTCROLLBACKREP(), and report_node_failure().
NdbScanOperation* NdbTransaction::theScanningOp [private] |
Definition at line 790 of file NdbTransaction.hpp.
Referenced by NdbScanOperation::close(), Ndb::handleReceivedSignal(), init(), receiveSCAN_TABCONF(), receiveSCAN_TABREF(), and releaseOperations().
SendStatusType NdbTransaction::theSendStatus [private] |
Definition at line 707 of file NdbTransaction.hpp.
Referenced by Ndb::abortTransactionsAfterNodeFailure(), doSend(), executeAsynchPrepare(), handleExecuteCompletion(), Ndb::handleReceivedSignal(), init(), receiveTCKEY_FAILREF(), sendCOMMIT(), and sendROLLBACK().
bool NdbTransaction::theSimpleState [private] |
Definition at line 755 of file NdbTransaction.hpp.
Referenced by NdbOperation::deleteTuple(), NdbOperation::dirtyUpdate(), NdbOperation::dirtyWrite(), executeAsynchPrepare(), init(), NdbOperation::insertTuple(), NdbOperation::interpretedDeleteTuple(), NdbOperation::interpretedUpdateTuple(), NdbOperation::readTuple(), NdbOperation::readTupleExclusive(), NdbScanOperation::takeOverScanOp(), NdbOperation::updateTuple(), and NdbOperation::writeTuple().
Definition at line 712 of file NdbTransaction.hpp.
ConStatusType NdbTransaction::theStatus [private] |
Definition at line 738 of file NdbTransaction.hpp.
Referenced by checkState_TransId(), receiveDIHNDBTAMPER(), receiveTCRELEASECONF(), receiveTCRELEASEREF(), receiveTCSEIZECONF(), receiveTCSEIZEREF(), and Status().
Uint32 NdbTransaction::theTCConPtr [private] |
Definition at line 735 of file NdbTransaction.hpp.
Referenced by Ndb::closeTransaction(), NdbScanOperation::doSendScan(), executeAsynchPrepare(), NdbScanOperation::executeCursor(), getTC_ConnectPtr(), receiveTCSEIZECONF(), NdbScanOperation::send_next_scan(), NdbIndexScanOperation::send_next_scan_ordered(), sendCOMMIT(), sendROLLBACK(), sendTC_HBREP(), and setTC_ConnectPtr().
Uint64 NdbTransaction::theTransactionId [private] |
Definition at line 736 of file NdbTransaction.hpp.
Referenced by checkState_TransId(), NdbScanOperation::doSendScan(), executeAsynchPrepare(), NdbScanOperation::executeCursor(), getTransactionId(), restart(), NdbScanOperation::send_next_scan(), NdbIndexScanOperation::send_next_scan_ordered(), sendCOMMIT(), sendROLLBACK(), sendTC_HBREP(), and setTransactionId().
bool NdbTransaction::theTransactionIsStarted [private] |
Definition at line 753 of file NdbTransaction.hpp.
Referenced by doSend(), executeAsynchPrepare(), init(), NdbScanOperation::nextResultImpl(), release(), restart(), sendROLLBACK(), and setOperationErrorCodeAbort().
Uint32 NdbTransaction::theTransArrayIndex [private] |
Definition at line 710 of file NdbTransaction.hpp.
Referenced by Ndb::completedTransaction(), executeAsynchPrepare(), Ndb::insert_completed_list(), and Ndb::insert_sent_list().
1.4.7

