company logo

Database :: assign - Assign database handle

The function creates a copy of a database handle. The function is called in OSI or C++ functions when assigning databases by using the operator=.

Return value:  Database handle ( odaba::Database & )

The database handle refers to an (usually) opened database. Calling functions with invalid database handles may cause an exception. For checking the database handle, isValid() can be called.

Implementation details

odaba::Database & Database  :: assign ( odaba::Database &cDatabase )

This function creates a copy of the database handle passed in cDatabase. Both, the copy and the origin are referring to the same access object. The access object will be closed when closing the last database handle referring to it, regardless on the sequence the handles have been opened.

Handle copies for the same database access object must not be used in different threads. In order to provide thread-save database access, object space access copies should be used.

If cDatabase is not opened, the calling database handle will be closed.

  • cDatabase - Database handle

    The database handle refers to an (usually) opened database. Calling functions with invalid database handles may cause an exception. For checking the database handle, isValid() can be called.