Product Documentation

FairCom DB API for C

Previous Topic

Next Topic

ctdbFindActiveDatabaseByUID

Get the handle of an active/connected database by its unique identifier.

Declaration

CTHANDLE ctdbFindActiveDatabaseByUID(CTHANDLE Handle, ULONG uid)

Description

ctdbFindActiveDatabaseByUID() retrieves the handle of an active/connected database in a session by its unique identifier. A database is considered "active" for a given client application if that client has connected that database to the session handle using the ctdbConnect() function.

Note that the UID of a database persists as long as that database remains in the session dictionary. Removing a database from a session dictionary and then re-adding it to the session dictionary is very likely to change that database’s UID.

Use ctdbFindActiveDatabase() to get the handle of an active database by name. Use ctdbGetDatabaseUID() or ctdbGetActiveDatabaseUID() to retrieve the database UID.

  • Handle [in] - handle of the session that will be searched.
  • uid [in] - the unique database identifier, used to locate the database. It is set automatically when the database is created and when the database is added to a session dictionary.

Returns

ctdbFindActiveDatabaseByUID() returns the database handle or NULL if the database is not in the session dictionary or is not active/connected. Note: If the specified database is not in the session dictionary, then the UID must be considered invalid.

See also

ctdbFindDatabaseByUID(), ctdbFindActiveDatabase(), ctdbGetDatabaseUID(), ctdbGetActiveDatabaseUID()

TOCIndex