Product Documentation

c-treeDB API API for C

Previous Topic

Next Topic

ctdbIsDatabaseExclusive

Retrieves the status of the database exclusive flag.

DECLARATION

CTBOOL ctdbIsDatabaseExclusive(CTHANDLE Handle);

DESCRIPTION

ctdbIsDatabaseExclusive() retrieves the status of the database exclusive flag.

  • Handle is a session Handle.

RETURN

Value

Symbolic Constant

Explanation

0

NO

Batch operation not underway.

1

YES

Batch operation underway.

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

EXAMPLE

/* verify an exclusive logon and connect */

CTHANDLE hSession = ctdbAllocSession(CTSESSION_CTDB);

if (hSession)

{

ctdbSetSessionExclusive(hSession, YES);

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

printf("ctdbLogon failed\n");

}

if (ctdbIsSessionExclusive(hSession))

printf("Session is exclusive\n");

else

printf("Session is shared\n");

if (ctdbIsDatabaseExclusive(hDatabase))

printf("Database is exclusive\n");

else

printf("Database is shared\n");

ctdbFreeDatabase(hDatabase);

ctdbFreeSession(hSession);

SEE ALSO

ctdbSetSessionExclusive(), ctdbIsSessionExclusive(), ctdbSetDatabaseExclusive()

TOCIndex