18 #ifndef NdbTransaction_H
19 #define NdbTransaction_H
21 #include <ndb_types.h>
22 #include "NdbError.hpp"
23 #include "NdbDictionary.hpp"
25 #include "NdbOperation.hpp"
26 #include "NdbIndexScanOperation.hpp"
42 #ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
54 #ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
147 #ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
160 #ifdef NDBAPI_50_COMPAT
176 #ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
183 #ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
187 #ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
191 #ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
196 #ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
205 #ifndef DOXYGEN_SHOULD_SKIP_DEPRECATED
232 #ifndef DOXYGEN_SHOULD_SKIP_DEPRECATED
255 #ifndef DOXYGEN_SHOULD_SKIP_DEPRECATED
266 const char* aTableName);
283 #ifndef DOXYGEN_SHOULD_SKIP_DEPRECATED
295 const char* aTableName);
339 #ifndef NDBAPI_50_COMPAT
343 #ifndef DOXYGEN_SHOULD_SKIP_DEPRECATED
344 int execute(::ExecType execType,
345 ::AbortOption abortOption = ::DefaultAbortOption,
347 return execute ((ExecType)execType,
360 NdbTransaction::AbortOption abortOption = AbortOnError,
366 if (ret || (abortOption != AO_IgnoreError && theError.
code))
372 #ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
397 #ifndef NDBAPI_50_COMPAT
399 NdbAsynchCallback callback,
402 #ifndef DOXYGEN_SHOULD_SKIP_DEPRECATED
404 NdbAsynchCallback callback,
406 ::AbortOption ao = ::DefaultAbortOption) {
416 NdbAsynchCallback callback,
421 NdbAsynchCallback callback,
423 NdbTransaction::AbortOption abortOption = NdbTransaction::AbortOnError)
443 #ifndef NDBAPI_50_COMPAT
445 NdbAsynchCallback aCallback,
449 #ifndef DOXYGEN_SHOULD_SKIP_DEPRECATED
451 NdbAsynchCallback aCallback,
453 ::AbortOption abortOption= ::DefaultAbortOption,
464 NdbAsynchCallback aCallback,
469 NdbAsynchCallback aCallback,
471 NdbTransaction::AbortOption abortOption = AbortOnError)
496 #ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
509 #ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
556 int getGCI(Uint64 * gciptr);
656 #ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
657 const NdbOperation* getFirstDefinedOperation()
const{
return theFirstOpInList;}
658 const NdbOperation* getLastDefinedOperation()
const{
return theLastOpInList;}
725 const NdbRecord *result_rec,
char *result_row,
727 const unsigned char *result_mask= 0,
729 Uint32 sizeOfOptions = 0);
731 const NdbRecord *attr_rec,
const char *attr_row,
732 const unsigned char *mask= 0,
734 Uint32 sizeOfOptions = 0);
736 const unsigned char *mask = 0,
738 Uint32 sizeOfOptions = 0);
740 const NdbRecord *attr_rec,
const char *attr_row,
741 const unsigned char *mask= 0,
743 Uint32 sizeOfOptions = 0);
745 const NdbRecord *attr_rec,
const char *attr_row,
746 const unsigned char *mask= 0,
748 Uint32 sizeOfOptions = 0);
750 const NdbRecord *result_rec,
char *result_row = 0,
751 const unsigned char *result_mask = 0,
753 Uint32 sizeOfOptions = 0);
755 #ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
758 Uint32 sizeOfOptions = 0);
786 const unsigned char *result_mask= 0,
788 Uint32 sizeOfOptions = 0);
831 const unsigned char *result_mask = 0,
834 Uint32 sizeOfOptions = 0);
922 Uint32 getMaxPendingBlobReadBytes()
const;
923 Uint32 getMaxPendingBlobWriteBytes()
const;
928 void setMaxPendingBlobReadBytes(Uint32 bytes);
929 void setMaxPendingBlobWriteBytes(Uint32 bytes);
935 void releaseCompletedOperations();
936 void releaseCompletedQueries();
938 typedef Uint64 TimeMillis_t;
951 int executeNoBlobs(ExecType execType,
959 void setConnectedNodeId( Uint32 nodeId, Uint32 sequence);
961 void setMyBlockReference(
int );
962 void setTC_ConnectPtr( Uint32 );
963 int getTC_ConnectPtr();
964 void setBuddyConPtr(Uint32);
965 Uint32 getBuddyConPtr();
976 ConStatusType Status();
977 void Status(ConStatusType);
979 Uint32 get_send_size();
980 void set_send_size(Uint32);
982 int receiveTCSEIZECONF(
const NdbApiSignal* anApiSignal);
984 int receiveTCRELEASECONF(
const NdbApiSignal* anApiSignal);
985 int receiveTCRELEASEREF(
const NdbApiSignal* anApiSignal);
986 int receiveTC_COMMITCONF(
const class TcCommitConf *, Uint32 len);
987 int receiveTCKEYCONF(
const class TcKeyConf *, Uint32 aDataLength);
989 int receiveTCKEY_FAILREF(
const NdbApiSignal* anApiSignal);
990 int receiveTC_COMMITREF(
const NdbApiSignal* anApiSignal);
991 int receiveTCROLLBACKCONF(
const NdbApiSignal* anApiSignal);
992 int receiveTCROLLBACKREF(
const NdbApiSignal* anApiSignal);
993 int receiveTCROLLBACKREP(
const NdbApiSignal* anApiSignal);
996 int receiveSCAN_TABCONF(
const NdbApiSignal*,
const Uint32*, Uint32 len);
1002 void setGCI(
int GCI);
1004 int OpCompleteFailure();
1005 int OpCompleteSuccess();
1013 void releaseOperations();
1022 void releaseLockHandles();
1025 void setTransactionId(Uint64 aTransactionId);
1028 void setErrorCode(
int anErrorCode);
1031 void setOperationErrorCode(
int anErrorCode);
1034 void setOperationErrorCodeAbort(
int anErrorCode,
int abortOption = -1);
1039 bool useRec=
false);
1045 bool useRec=
false);
1053 const char *key_row,
1055 const char *attribute_row,
1056 const unsigned char *mask,
1058 Uint32 sizeOfOptions,
1061 void handleExecuteCompletion();
1071 enum SendStatusType {
1083 SendStatusType theSendStatus;
1084 NdbAsynchCallback theCallbackFunction;
1085 void* theCallbackObject;
1086 Uint32 theTransArrayIndex;
1088 TimeMillis_t theStartTransTime;
1107 Uint32 theNoOfOpSent;
1108 Uint32 theNoOfOpCompleted;
1111 Uint64 theTransactionId;
1112 Uint64 theGlobalCheckpointId;
1113 Uint64 *p_latest_trans_gci;
1114 ConStatusType theStatus;
1115 enum CompletionStatus {
1120 } theCompletionStatus;
1122 Uint32 theMagicNumber;
1130 enum ReturnType { ReturnSuccess, ReturnFailure };
1131 ReturnType theReturnStatus;
1133 bool theTransactionIsStarted;
1135 bool theSimpleState;
1145 Uint32 theNodeSequence;
1146 bool theReleaseOnClose;
1155 Uint32 m_db_nodes[2];
1156 Uint32 m_failed_db_nodes[2];
1158 int report_node_failure(Uint32
id);
1161 bool m_waitForReply;
1173 Uint32 theBuddyConPtr;
1176 Uint8 thePendingBlobOps;
1177 Uint32 maxPendingBlobReadBytes;
1178 Uint32 maxPendingBlobWriteBytes;
1179 Uint32 pendingBlobReadBytes;
1180 Uint32 pendingBlobWriteBytes;
1181 inline bool hasBlobOperation() {
return theBlobFlag; }
1184 Uint32 transId1, Uint32 transId2,
1187 void completedFail(
const char * s);
1191 bool checkState_TransId(
const Uint32 * transId)
const;
1221 #ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
1225 NdbTransaction::get_send_size()
1232 NdbTransaction::set_send_size(Uint32 send_size)
1238 #ifdef NDB_NO_DROPPED_SIGNAL
1244 NdbTransaction::checkMagicNumber()
1246 if (theMagicNumber == 0x37412619)
1249 #ifdef NDB_NO_DROPPED_SIGNAL
1258 NdbTransaction::checkState_TransId(
const Uint32 * transId)
const {
1259 const Uint32 tTmp1 = transId[0];
1260 const Uint32 tTmp2 = transId[1];
1261 Uint64 tRecTransId = (Uint64)tTmp1 + ((Uint64)tTmp2 << 32);
1262 bool b = theStatus == Connected && theTransactionId == tRecTransId;
1273 NdbTransaction::setTransactionId(Uint64 aTransactionId)
1275 theTransactionId = aTransactionId;
1280 NdbTransaction::setConnectedNodeId(Uint32 aNode, Uint32 aSequenceNo)
1283 theNodeSequence = aSequenceNo;
1305 NdbTransaction::setMyBlockReference(
int aBlockRef)
1307 theMyRef = aBlockRef;
1317 NdbTransaction::setTC_ConnectPtr(Uint32 aTCConPtr)
1319 theTCConPtr = aTCConPtr;
1330 NdbTransaction::getTC_ConnectPtr()
1337 NdbTransaction::setBuddyConPtr(Uint32 aBuddyConPtr)
1339 theBuddyConPtr = aBuddyConPtr;
1343 Uint32 NdbTransaction::getBuddyConPtr()
1345 return theBuddyConPtr;
1369 NdbTransaction::next()
1384 theNext = aTransaction;
1395 NdbTransaction::ConStatusType
1396 NdbTransaction::Status()
1409 NdbTransaction::Status( ConStatusType aStatus )
1411 theStatus = aStatus;
1422 NdbTransaction::OpSent()
1434 if (thePendingBlobOps & flags) {
1443 NdbTransaction::ptr2int(){
1449 #endif // ifndef DOXYGEN_SHOULD_SKIP_INTERNAL