Product Documentation

FairCom DB API for C

Previous Topic

Next Topic

CTDB_ON_TABLE_CLOSE

A CTDB_ON_TABLE_CLOSE callback is invoked before the FairCom DB data and index files are closed, but before the ctdbCloseTable() function returns. The handle passed as a parameter with this callback is a table handle and you can safely typecast the handle parameter to a pCTDBTABLE structure pointer. The close table callback may be used to undo and cleanup operations performed by the table open callback.

FairCom DB API C API Example


CTDBRET ctdbDECL OnTableClose(CTHANDLE Handle)

{

pCTDBTABLE pTable = (pCTDBTABLE)Handle;

if (pTable && pTable->localTag)

{

pCTDBSESSION pSession = (pCTDBSESSION)pTable->pSession;

pLOCALTABLE pLocal = (pLOCALTABLE)pTable->localTag;

if (pLocal)

{

if (pLocal->dodaptr)

pSession->onFree(pLocal->dodaptr);

pSession->onFree(pTable->localTag);

}

pTable->localTag = NULL;

}

return CTDBRET_OK;

}

TOCIndex