DbEnv::open API Ref

#include <db_cxx.h>

int DbEnv::open(const char *db_home, u_int32_t flags, int mode);

int DbEnv::get_home(const char **homep);

int DbEnv::get_open_flags(u_int32_t *flagsp);


Description: DbEnv::open

The DbEnv::open method opens a Berkeley DB environment. It provides a structure for creating a consistent environment for processes using one or more of the features of Berkeley DB.

The DbEnv::open method either returns a non-zero error value or throws an exception that encapsulates a non-zero error value on failure, and returns 0 on success. If DbEnv::open fails, the DbEnv::close method must be called to discard the DbEnv handle.

Parameters
db_home

When using a Unicode build on Windows (the default), the db_home argument will be interpreted as a UTF-8 string, which is equivalent to ASCII for Latin characters.

flags mode

Errors

The DbEnv::open method may fail and throw DbException, encapsulating one of the following non-zero errors, or return one of the following non-zero errors:


DB_RUNRECOVERY

DB_VERSION_MISMATCH

EAGAIN

EINVAL

ENOSPC

ENOENT

Description: DbEnv::get_home

The DbEnv::get_home method returns the database environment home directory.

The DbEnv::get_home method may be called at any time during the life of the application.


Description: DbEnv::get_open_flags

The DbEnv::get_open_flags method returns the open method flags originally used to create the database environment.

The DbEnv::get_open_flags method may not be called before the DbEnv::open method is called.

The DbEnv::get_open_flags method either returns a non-zero error value or throws an exception that encapsulates a non-zero error value on failure, and returns 0 on success.

Parameters
flagsp


Class DbEnv
See Also Database Environments and Related Methods

APIRef

Copyright (c) 1996,2008 Oracle. All rights reserved.