diff options
Diffstat (limited to 'ndb/src/ndbapi/Ndblist.cpp')
-rw-r--r-- | ndb/src/ndbapi/Ndblist.cpp | 44 |
1 files changed, 24 insertions, 20 deletions
diff --git a/ndb/src/ndbapi/Ndblist.cpp b/ndb/src/ndbapi/Ndblist.cpp index 3001561a73a..f82348fc91d 100644 --- a/ndb/src/ndbapi/Ndblist.cpp +++ b/ndb/src/ndbapi/Ndblist.cpp @@ -19,7 +19,6 @@ #include <NdbOperation.hpp> #include <NdbIndexOperation.hpp> #include <NdbIndexScanOperation.hpp> -#include <NdbConnection.hpp> #include "NdbApiSignal.hpp" #include <NdbRecAttr.hpp> #include "NdbUtil.hpp" @@ -51,10 +50,10 @@ Ndb::checkFailedNode() /** * Release all connections in idle list (for node) */ - NdbConnection * tNdbCon = theConnectionArray[node_id]; + NdbTransaction * tNdbCon = theConnectionArray[node_id]; theConnectionArray[node_id] = NULL; while (tNdbCon != NULL) { - NdbConnection* tempNdbCon = tNdbCon; + NdbTransaction* tempNdbCon = tNdbCon; tNdbCon = tNdbCon->next(); releaseNdbCon(tempNdbCon); } @@ -71,7 +70,7 @@ Ndb::checkFailedNode() * if createConIdleList was succesful * Return -1: In all other case. * Parameters: aNrOfCon : Number of connections offered to the application. - * Remark: Create connection idlelist with NdbConnection objects. + * Remark: Create connection idlelist with NdbTransaction objects. ***************************************************************************/ int Ndb::createConIdleList(int aNrOfCon) @@ -123,23 +122,16 @@ Ndb::getNdbCall() } /*************************************************************************** - * NdbConnection* getNdbCon(); + * NdbTransaction* getNdbCon(); * * Return Value: Return a connection if the getNdbCon was successful. * Return NULL : In all other case. * Remark: Get a connection from theConIdleList and return the object . ***************************************************************************/ -NdbConnection* +NdbTransaction* Ndb::getNdbCon() { - NdbConnection* tNdbCon = theImpl->theConIdleList.seize(this); - if (unlikely(theImpl->theConIdleList.m_alloc_cnt > theMaxNoOfTransactions)) - { - theImpl->theConIdleList.release(tNdbCon); - ndbout << "theNoOfAllocatedTransactions = " << theNoOfAllocatedTransactions << " theMaxNoOfTransactions = " << theMaxNoOfTransactions << endl; - return NULL; - }//if - + NdbTransaction* tNdbCon = theImpl->theConIdleList.seize(this); tNdbCon->theMagicNumber = 0x37412619; return tNdbCon; } @@ -290,13 +282,13 @@ Ndb::releaseNdbCall(NdbCall* aNdbCall) } /*************************************************************************** -void releaseNdbCon(NdbConnection* aNdbCon); +void releaseNdbCon(NdbTransaction* aNdbCon); -Parameters: aNdbCon: The NdbConnection object. +Parameters: aNdbCon: The NdbTransaction object. Remark: Add a Connection object into the signal idlelist. ***************************************************************************/ void -Ndb::releaseNdbCon(NdbConnection* aNdbCon) +Ndb::releaseNdbCon(NdbTransaction* aNdbCon) { aNdbCon->theMagicNumber = 0xFE11DD; theImpl->theConIdleList.release(aNdbCon); @@ -368,9 +360,20 @@ Remark: Add a NdbScanOperation object into the signal idlelist. void Ndb::releaseScanOperation(NdbIndexScanOperation* aScanOperation) { + DBUG_ENTER("Ndb::releaseScanOperation"); + DBUG_PRINT("enter", ("op=%x", (UintPtr)aScanOperation)); +#ifdef ndb_release_check_dup + { NdbIndexScanOperation* tOp = theScanOpIdleList; + while (tOp != NULL) { + assert(tOp != aScanOperation); + tOp = (NdbIndexScanOperation*)tOp->theNext; + } + } +#endif aScanOperation->theNdbCon = NULL; aScanOperation->theMagicNumber = 0xFE11D2; theImpl->theScanOpIdleList.release(aScanOperation); + DBUG_VOID_RETURN; } /*************************************************************************** @@ -426,18 +429,19 @@ Ndb::releaseSignalsInList(NdbApiSignal** pList){ void Ndb::releaseNdbBlob(NdbBlob* aBlob) { + aBlob->release(); theImpl->theNdbBlobIdleList.release(aBlob); } /**************************************************************************** -int releaseConnectToNdb(NdbConnection* aConnectConnection); +int releaseConnectToNdb(NdbTransaction* aConnectConnection); Return Value: -1 if error Parameters: aConnectConnection : Seized schema connection to DBTC Remark: Release and disconnect from DBTC a connection and seize it to theConIdleList. *****************************************************************************/ void -Ndb::releaseConnectToNdb(NdbConnection* a_con) +Ndb::releaseConnectToNdb(NdbTransaction* a_con) { DBUG_ENTER("Ndb::releaseConnectToNdb"); NdbApiSignal tSignal(theMyRef); @@ -455,7 +459,7 @@ Ndb::releaseConnectToNdb(NdbConnection* a_con) tSignal.setData((tConPtr = a_con->getTC_ConnectPtr()), 1); tSignal.setData(theMyRef, 2); tSignal.setData(a_con->ptr2int(), 3); - a_con->Status(NdbConnection::DisConnecting); + a_con->Status(NdbTransaction::DisConnecting); a_con->theMagicNumber = 0x37412619; int ret_code = sendRecSignal(node_id, WAIT_TC_RELEASE, |