Allocating a Session HandleA valid session handle is required to perform any session operation. The session handle must be allocated using ctdbAllocSession(). When the session handle is no longer needed it may be freed using ctdbFreeSession(). CTHANDLE hSession; hSession = ctdbAllocSession(CTSESSION_CTDB); if (!hSession) FatalError(“Session handle allocation failed\n”); /* ... some other statements ... */ ctdbFreeSession(hSession); When allocating a session handle, specify the session handle type. There are three different session handle 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. Allocate table handles using the session handle. CTSESSION_CTDB Allocate a new session making full usage of c-treeDB session and database dictionaries. With this session mode, a Session dictionary file must exist to perform a session logon and you must connect to a database before attempting to perform operation on tables. CTSESSION_SQL Allocate a new session for c-treeACE SQL processing. This mode allows changes made at the c-treeDB level to be reflected at the c-treeACE SQL level without requiring an additional table import step; your tables are immediately available with the c-treeACE SQL interface. While this session type is available, limitations still exist. Support for alter table operations are not supported; c-treeDB AlterTable() activities are NOT reflected in the c-treeACE SQL system tables. |
|||