FairCom Corporation


4.3.12 ctdbAllocSession


Allocate a new session handle and set the default attributes.

Declaration

CTHANDLE ctdbAllocSession(CTSESSION_TYPE SessionType)

Description

ctdbAllocSession allocates memory and initialize a new session handle, setting the default attributes. Before any operation on session can take place, the application must allocate a session handle. This function takes one parameter, the session type, and returns the new session handle, or NULL if there is not enough memory to allocate the new handle.

The session handle is released by calling ctdbFreeSession. Do not release the session handle by calling the C runtime library function free.

Returns

Return the session handle on success or NULL on failure.

Example

CTSESSION_TYPE ctdbsess=CTSESSION_CTDB;
CTHANDLE handle = ctdbAllocSession(ctdbsess); // c-treeDB session

See also

ctdbAllocDataBase, ctdbFreeSession


FairCom Corporation
www.faircom.com