Chapter 3. Db_container
Prev |  | Next

## Chapter 3. Db_container

This class is the base class for all db container classes, you don't directly use this class, but all container classes inherit from this class, so you need to know the methods that can be accessed via concrete container classes.

This class is also used to support auto commit transactions. Autocommit is enabled when DB_AUTO_COMMIT is set to the database or database environment handle and the environment is transactional.

Inside dbstl, there are transactions begun and committed/aborted if the backing database and/or environment requires auto commit, and there are cursors opened internally, and you can set the flags used by the transaction and cursor functions via set functions of this class.

All dbstl containers are fully multi-threaded, you should not need any synchronization to use them in the correct way, but this class is not thread safe, access to its members are not proctected by any mutex because the data members of this class are supposed to be set before they are used, and remain read only afterwards. If this is not the case, you must synchronize the access.

#### Public Members

Member | Description
--- | ---
get_db_open_flags | Get the backing database's open flags.
get_db_set_flags | Get the backing database's flags that are set via Db::set_flags() function.
get_db_handle | Get the backing database's handle.
get_db_env_handle | Get the backing database environment's handle.
set_db_handle | Set the underlying database's handle, and optionally environment handle if the environment has also changed.
set_all_flags | Set the flags required by the Berkeley DB functions DbEnv::txn_begin(), DbTxn::commit() and DbEnv::cursor().
set_txn_begin_flags | Set flag of DbEnv::txn_begin() call.
get_txn_begin_flags | Get flag of DbEnv::txn_begin() call.
set_commit_flags | Set flag of DbTxn::commit() call.
get_commit_flags | Get flag of DbTxn::commit() call.
get_cursor_open_flags | Get flag of Db::cursor() call.
set_cursor_open_flags | Set flag of Db::cursor() call.
db_container | Default constructor.
~db_container | The backing database is not closed in this function.

#### Group

Dbstl Container Classes

## get_db_open_flags

### Function Details

    u_int32_t get_db_open_flags() const

Get the backing database's open flags.

#### Return Value

The backing database's open flags.

### Group: Get and set functions for data members.

Note that these functions are not thread safe, because all data members of db_container are supposed to be set on container construction and initialization, and remain read only afterwards.

### Class

db_container

Prev |  | Next
Chapter 2. Dbstl Container Classes | Home | get_db_set_flags