2
<!--Copyright 1997-2001 by Sleepycat Software, Inc.-->
3
<!--All rights reserved.-->
6
<title>Berkeley DB: DbEnv::set_flags</title>
7
<meta name="description" content="Berkeley DB: An embedded database programmatic toolkit.">
8
<meta name="keywords" content="embedded,database,programmatic,toolkit,b+tree,btree,hash,hashing,transaction,transactions,locking,logging,access method,access methods,java,C,C++">
11
<a name="2"><!--meow--></a>
12
<table width="100%"><tr valign=top>
14
<h1>DbEnv::set_flags</h1>
17
<a href="../api_cxx/cxx_index.html"><img src="../images/api.gif" alt="API"></a><a href="../reftoc.html"><img src="../images/ref.gif" alt="Ref"></a>
22
#include <db_cxx.h>
25
DbEnv::set_flags(u_int32_t flags, int onoff);
28
<p>The <b>flags</b> value must be set to 0 or by bitwise inclusively <b>OR</b>'ing together one or
29
more of the following values:
30
If <b>onoff</b> is set to
32
the specified flags are cleared; otherwise they are set.
34
<a name="3"><!--meow--></a>
35
<p><dt><a name="DB_CDB_ALLDB">DB_CDB_ALLDB</a><dd>For Berkeley DB Concurrent Data Store applications, perform locking on an environment-wide basis
36
rather than per-database. This flag may be used only to configure Berkeley DB
37
before the <a href="../api_cxx/env_open.html">DbEnv::open</a> interface is called.
38
<a name="4"><!--meow--></a>
39
<p><dt><a name="DB_NOMMAP">DB_NOMMAP</a><dd>Copy read-only database files in this environment into the local cache
40
instead of potentially mapping them into process memory (see the
41
description of the <a href="../api_cxx/env_set_mp_mmapsize.html">DbEnv::set_mp_mmapsize</a> method for further information).
42
<a name="5"><!--meow--></a>
43
<p><dt><a name="DB_TXN_NOSYNC">DB_TXN_NOSYNC</a><dd>Do not synchronously flush the log on transaction commit or prepare.
44
This means that transactions exhibit the ACI (atomicity, consistency,
45
and isolation) properties, but not D (durability); that is, database
46
integrity will be maintained, but it is possible that some number of the
47
most recently committed transactions may be undone during recovery.
48
<p>The number of transactions potentially at risk is governed by how often
49
the log is checkpointed (see <a href="../utility/db_checkpoint.html">db_checkpoint</a> for more information)
50
and how many log updates can fit into the log buffer.
52
<p>The DbEnv::set_flags method either returns a non-zero error value or throws an exception that
53
encapsulates a non-zero error value on failure, and returns 0 on success.
54
<p>The database environment's flag values may also be set using the environment's
55
<b>DB_CONFIG</b> file. The syntax of the entry in that file is a
56
single line with the string "set_flags", one or more whitespace characters,
57
and the interface flag argument as a string; for example, "set_flags
58
DB_TXN_NOSYNC". Because the <b>DB_CONFIG</b> file is read when the database
59
environment is opened, it will silently overrule configuration done
62
<p>The DbEnv::set_flags method may fail and throw an exception or return a non-zero error for the following conditions:
64
<p><dt>EINVAL<dd>An invalid flag value or parameter was specified.
66
<p>The DbEnv::set_flags 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.
67
If a catastrophic error has occurred, the DbEnv::set_flags method may fail and either
68
return <a href="../ref/program/errorret.html#DB_RUNRECOVERY">DB_RUNRECOVERY</a> or throw an exception encapsulating
69
<a href="../ref/program/errorret.html#DB_RUNRECOVERY">DB_RUNRECOVERY</a>, in which case all subsequent Berkeley DB calls will fail
72
<a href="../api_cxx/dbenv_class.html">DbEnv</a>
74
<a href="../api_cxx/env_close.html">DbEnv::close</a>,
75
<a href="../api_cxx/env_err.html">DbEnv::err</a>, <a href="../api_cxx/env_err.html">DbEnv::errx</a>
76
<a href="../api_cxx/env_open.html">DbEnv::open</a>,
77
<a href="../api_cxx/env_remove.html">DbEnv::remove</a>,
78
<a href="../api_cxx/env_set_alloc.html">DbEnv::set_alloc</a>,
79
<a href="../api_cxx/env_set_cachesize.html">DbEnv::set_cachesize</a>,
80
<a href="../api_cxx/env_set_data_dir.html">DbEnv::set_data_dir</a>,
81
<a href="../api_cxx/env_set_errcall.html">DbEnv::set_errcall</a>,
82
<a href="../api_cxx/env_set_errfile.html">DbEnv::set_errfile</a>,
83
<a href="../api_cxx/env_set_error_stream.html">DbEnv::set_error_stream</a>,
84
<a href="../api_cxx/env_set_errpfx.html">DbEnv::set_errpfx</a>,
85
<a href="../api_cxx/env_set_feedback.html">DbEnv::set_feedback</a>,
86
<a href="../api_cxx/env_set_flags.html">DbEnv::set_flags</a>,
87
<a href="../api_cxx/env_set_mutexlocks.html">DbEnv::set_mutexlocks</a>,
88
<a href="../api_cxx/env_set_pageyield.html">DbEnv::set_pageyield</a>,
89
<a href="../api_cxx/env_set_paniccall.html">DbEnv::set_paniccall</a>,
90
<a href="../api_cxx/env_set_panicstate.html">DbEnv::set_panicstate</a>,
91
<a href="../api_cxx/env_set_rec_init.html">DbEnv::set_recovery_init</a>,
92
<a href="../api_cxx/env_set_rpc_server.html">DbEnv::set_rpc_server</a>,
93
<a href="../api_cxx/env_set_region_init.html">DbEnv::set_region_init</a>,
94
<a href="../api_cxx/env_set_shm_key.html">DbEnv::set_shm_key</a>,
95
<a href="../api_cxx/env_set_tas_spins.html">DbEnv::set_tas_spins</a>,
96
<a href="../api_cxx/env_set_tmp_dir.html">DbEnv::set_tmp_dir</a>,
97
<a href="../api_cxx/env_set_verbose.html">DbEnv::set_verbose</a>,
98
<a href="../api_cxx/env_strerror.html">DbEnv::strerror</a>
100
<a href="../api_cxx/env_version.html">DbEnv::version</a>.
102
<table width="100%"><tr><td><br></td><td align=right>
103
<a href="../api_cxx/cxx_index.html"><img src="../images/api.gif" alt="API"></a><a href="../reftoc.html"><img src="../images/ref.gif" alt="Ref"></a>
105
<p><font size=1><a href="http://www.sleepycat.com">Copyright Sleepycat Software</a></font>