head 1.2; access; symbols RPM_4_2_1:1.1.1.5 RPM_4_2:1.1.1.5 RPM_4_1_1:1.1.1.5 RPM_4_1:1.1.1.4 RPM_4_0_5:1.1.1.3 RPM_4_0_4:1.1.1.2 RPM_4_0_3:1.1.1.1 RPM:1.1.1; locks; strict; comment @# @; 1.2 date 2008.01.02.09.53.26; author rse; state dead; branches; next 1.1; commitid z4cpSiAhOCXk5PLs; 1.1 date 2001.07.23.20.45.36; author rse; state Exp; branches 1.1.1.1; next ; 1.1.1.1 date 2001.07.23.20.45.36; author rse; state Exp; branches; next 1.1.1.2; 1.1.1.2 date 2002.01.08.00.30.09; author rse; state Exp; branches; next 1.1.1.3; 1.1.1.3 date 2003.01.18.13.48.59; author rse; state Exp; branches; next 1.1.1.4; 1.1.1.4 date 2001.12.06.00.08.04; author rse; state Exp; branches; next 1.1.1.5; 1.1.1.5 date 2003.01.18.14.04.57; author rse; state Exp; branches; next ; desc @@ 1.2 log @remove the ancient RPM 4.2.1 source tree copy @ text @
DbEnv::remove |
![]() ![]() |
#include <db_cxx.h>int DbEnv::remove(const char *db_home, u_int32_t flags);
The DbEnv::remove method destroys a Berkeley DB environment if it is not currently in use. The environment regions, including any backing files, are removed. Any log or database files and the environment directory are not removed.
The db_home argument to DbEnv::remove is described in Berkeley DB File Naming.
If there are processes that have called DbEnv::open without calling DbEnv::close (that is, there are processes currently using the environment), DbEnv::remove will fail without further action unless the DB_FORCE flag is set, in which case DbEnv::remove will attempt to remove the environment, regardless of any processes still using it.
The result of attempting to forcibly destroy the environment when it is in use is unspecified. Processes using an environment often maintain open file descriptors for shared regions within it. On UNIX systems, the environment removal will usually succeed, and processes that have already joined the region will continue to run in that region without change. However, processes attempting to join the environment will either fail or create new regions. On other systems in which the unlink(2) system call will fail if any process has an open file descriptor for the file (for example Windows/NT), the region removal will fail.
Calling DbEnv::remove should not be necessary for most applications because the Berkeley DB environment is cleaned up as part of normal database recovery procedures. However, applications may want to call DbEnv::remove as part of application shut down to free up system resources. For example, if the DB_SYSTEM_MEM flag was specified to DbEnv::open, it may be useful to call DbEnv::remove in order to release system shared memory segments that have been allocated. Or, on architectures in which mutexes require allocation of underlying system resources, it may be useful to call DbEnv::remove in order to release those resources. Alternatively, if recovery is not required because no database state is maintained across failures, and no system resources need to be released, it is possible to clean up an environment by simply removing all the Berkeley DB files in the database environment's directories.
The flags value must be set to 0 or by bitwise inclusively OR'ing together one or more of the following values:
In multithreaded applications, only a single thread may call DbEnv::remove.
A DbEnv handle that has already been used to open an environment should not be used to call the DbEnv::remove method; a new DbEnv handle should be created for that purpose.
After DbEnv::remove has been called, regardless of its return, the Berkeley DB environment handle may not be accessed again.
The DbEnv::remove 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.
The DbEnv::remove method may fail and throw an exception or return a non-zero error for errors specified for other Berkeley DB and C library or system methods. If a catastrophic error has occurred, the DbEnv::remove method may fail and either return DB_RUNRECOVERY or throw an exception encapsulating DB_RUNRECOVERY, in which case all subsequent Berkeley DB calls will fail in the same way.
![]() ![]() |
Copyright Sleepycat Software
@
1.1
log
@Initial revision
@
text
@d1 1
a1 1
@
1.1.1.1
log
@Import: RPM 4.0.3
@
text
@@
1.1.1.2
log
@Import: RPM 4.0.4
@
text
@d1 1
a1 1
d17 1
a17 1
d117 2
d120 1
d123 1
a126 1
DbEnv::set_timeout,
d133 1
a133 1
@
1.1.1.3
log
@Import: RPM 4.0.5
@
text
@d1 2
a2 2
a3 1
d74 2
a75 2
used in file naming for all users only if the DB_USE_ENVIRON
flag is set.
d78 4
a81 4
are used can create security problems, if the
DB_USE_ENVIRON_ROOT flag is set, environment information will
be used for file naming only for users with appropriate permissions (for
example, users with a user-ID of 0 on UNIX systems).
d85 1
a85 1
A DbEnv handle that has already been used to open an environment d87 1 a87 1 DbEnv handle should be created for that purpose. a95 4
If the file or directory does not exist, the DbEnv::remove method will fail and and either return ENOENT or throw a FileNotFoundException exception. d97 4 a100 4 If a catastrophic error has occurred, the DbEnv::remove method may fail and either return DB_RUNRECOVERY or throw a DbRunRecoveryException, in which case all subsequent Berkeley DB calls will fail in the same way. d102 1 a102 1 DbEnv d104 24 a127 1 Database Environments and Related Methods @ 1.1.1.4 log @Import: RPM 4.1 @ text @d1 2 a2 2 d4 1 d75 2 a76 2 used in file naming for all users only if the DB_USE_ENVIRON flag is set. d79 4 a82 4 are used can create security problems, if the DB_USE_ENVIRON_ROOT flag is set, environment information will be used for file naming only for users with appropriate permissions (for example, users with a user-ID of 0 on UNIX systems). d86 1 a86 1
A DbEnv handle that has already been used to open an environment d88 1 a88 1 DbEnv handle should be created for that purpose. d97 4 d102 4 a105 4 If a catastrophic error has occurred, the DbEnv::remove method may fail and either return DB_RUNRECOVERY or throw an exception encapsulating DB_RUNRECOVERY, in which case all subsequent Berkeley DB calls will fail in the same way. d107 1 a107 1 DbEnv d109 1 a109 24 DbEnv::close, DbEnv::err, DbEnv::errx DbEnv::open, DbEnv::remove, DbEnv::set_alloc, DbEnv::set_cachesize, DbEnv::set_data_dir, DbEnv::set_errcall, DbEnv::set_errfile, DbEnv::set_error_stream, DbEnv::set_errpfx, DbEnv::set_feedback, DbEnv::set_flags, DbEnv::set_paniccall, DbEnv::set_recovery_init, DbEnv::set_rpc_server, DbEnv::set_shm_key, DbEnv::set_tas_spins, DbEnv::set_tmp_dir, DbEnv::set_timeout, DbEnv::set_verbose, DbEnv::strerror and DbEnv::version. @ 1.1.1.5 log @Import: RPM 4.1.1 @ text @d1 2 a2 2 a3 1 d74 2 a75 2 used in file naming for all users only if the DB_USE_ENVIRON flag is set. d78 4 a81 4 are used can create security problems, if the DB_USE_ENVIRON_ROOT flag is set, environment information will be used for file naming only for users with appropriate permissions (for example, users with a user-ID of 0 on UNIX systems). d85 1 a85 1
A DbEnv handle that has already been used to open an environment d87 1 a87 1 DbEnv handle should be created for that purpose. a95 4
If the file or directory does not exist, the DbEnv::remove method will fail and and either return ENOENT or throw a FileNotFoundException exception. d97 4 a100 4 If a catastrophic error has occurred, the DbEnv::remove method may fail and either return DB_RUNRECOVERY or throw a DbRunRecoveryException, in which case all subsequent Berkeley DB calls will fail in the same way. d102 1 a102 1 DbEnv d104 24 a127 1 Database Environments and Related Methods @