Product Documentation

c-treeDB API API for C

Previous Topic

Next Topic

ctdbFreeDatabase

Release all resources associated with a database handle

Declaration

void ctdbFreeDatabase(CTHANDLE Handle)

Description

ctdbFreeDatabase() releases all resources associated with a database handle. After a call to ctdbFreeDatabase(), the database handle cannot be used for other operations. For each ctdbAllocDatabase() call, there must be a ctdbFreeDatabase() call. Note that if you free / release an active database handle (one that is currently connected to a database), this function will automatically close all tables associated with that database and disconnect that database from the handle before releasing the handle’s resources.

  • Handle [in] the database handle.

Returns

None.

Example


CTHANDLE hDatabase = ctdbAllocDatabase(hSession);

ctdbCreateDatabase(hDatabase, "Database1", "");

ctdbFreeDatabase(hDatabase); // the handle cannot be used anymore

See also

ctdbAllocDatabase(), ctdbFreeSession()

TOCIndex