Product Documentation

FairCom DB API for C

Previous Topic

Next Topic

ctdbSetSessionExclusive

Sets or clears the session exclusive flag.

DECLARATION

CTDBRET ctdbSetSessionExclusive(CTHANDLE Handle, CTBOOL flag);

DESCRIPTION

ctdbSetSessionExclusive() sets or clears the session exclusive flag. If a session exclusive flag is set, only one CTSESSION_CTDB or CTSESSION_SQL session will be allowed. Set the session exclusive flag after allocating the session handle, but before performing a logon. Setting the session exclusive flag after a session logon is performed will not have any effect during the current session. Handle is a session handle. If flag is YES, this will set the exclusive flag, while NO will clear the exclusive flag.

RETURN

Value

Symbolic Constant

Explanation

0

CTDBRET_OK

No error occurred.

See Appendix A for a complete listing of valid c-tree Plus error values.

EXAMPLE

/* perform an exclusive logon */

CTHANDLE hSession = ctdbAllocSession(CTSESSION_CTDB);

if (hSession)

{

ctdbSetSessionExclusive(hSession, YES);

if (ctdbLogon(hSession, "FAIRCOM", "ADMIN", "ADMIN") != CTDBRET_OK)

printf("ctdbLogon failed\n");

}

ctdbFreeSession(hSession);

SEE ALSO

ctdbIsSessionExclusive(), ctdbSetDatabaseExclusive(), ctdbIsDatabaseExclusives()

TOCIndex