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.
- SessionType [in] the session type. There are three different session types:
- CTSESSION_CTREE: allocate a new session for logon only. No session or database dictionary files will be used. No database functions can be used with this session mode. Use the session handle to allocate table handles.
- CTSESSION_CTDB: allocate a new session using CTDB session and database dictionaries.
- CTSESSION_SQL: allocate a new session for SQL processing. This session type is not implemented yet and is reserved for future use.
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 sessionSee also
ctdbAllocDataBase, ctdbFreeSession
|
FairCom Corporation www.faircom.com |