• Home
  • History
  • Annotate
  • Line#
  • Navigate
  • Raw
  • Download
  • only in /asuswrt-rt-n18u-9.0.0.4.380.2695/release/src-rt-6.x.4708/router/db-4.8.30/docs/api_reference/C/
1<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3<html xmlns="http://www.w3.org/1999/xhtml">
4  <head>
5    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
6    <title>DB_ENV-&gt;set_flags()</title>
7    <link rel="stylesheet" href="apiReference.css" type="text/css" />
8    <meta name="generator" content="DocBook XSL Stylesheets V1.73.2" />
9    <link rel="start" href="index.html" title="Berkeley DB C API Reference" />
10    <link rel="up" href="env.html" title="Chapter��5.�� The DB_ENV Handle" />
11    <link rel="prev" href="envset_feedback.html" title="DB_ENV-&gt;set_feedback()" />
12    <link rel="next" href="envset_intermediate_dir_mode.html" title="DB_ENV-&gt;set_intermediate_dir_mode()" />
13  </head>
14  <body>
15    <div class="navheader">
16      <table width="100%" summary="Navigation header">
17        <tr>
18          <th colspan="3" align="center">DB_ENV-&gt;set_flags()</th>
19        </tr>
20        <tr>
21          <td width="20%" align="left"><a accesskey="p" href="envset_feedback.html">Prev</a>��</td>
22          <th width="60%" align="center">Chapter��5.��
23                The DB_ENV Handle
24        </th>
25          <td width="20%" align="right">��<a accesskey="n" href="envset_intermediate_dir_mode.html">Next</a></td>
26        </tr>
27      </table>
28      <hr />
29    </div>
30    <div class="sect1" lang="en" xml:lang="en">
31      <div class="titlepage">
32        <div>
33          <div>
34            <h2 class="title" style="clear: both"><a id="envset_flags"></a>DB_ENV-&gt;set_flags()</h2>
35          </div>
36        </div>
37      </div>
38      <pre class="programlisting">#include &lt;db.h&gt;
39
40int
41DB_ENV-&gt;set_flags(DB_ENV *dbenv, u_int32_t flags, int onoff);  </pre>
42      <p>
43        Configure a database environment.
44    </p>
45      <p>
46         The database environment's flag values may also be configured using
47         the environment's <a href="../../programmer_reference/env_db_config.html#env_db_config.DB_CONFIG" class="olink">DB_CONFIG</a> file.  The
48         syntax of the entry in that file is a single line with the string
49         "set_flags", one or more whitespace characters, and the method flag
50         parameter as a string; for example, "set_flags DB_TXN_NOSYNC". Because
51         the <a href="../../programmer_reference/env_db_config.html#env_db_config.DB_CONFIG" class="olink">DB_CONFIG</a>
52         file is read when the database environment is opened, it will silently
53         overrule configuration done before that time.
54    </p>
55      <p>
56         The <code class="methodname">DB_ENV-&gt;set_flags()</code> <span>
57            <span>
58                  method returns a non-zero error value on failure and 0 on success.
59            </span>
60            
61        </span>
62    </p>
63      <div class="sect2" lang="en" xml:lang="en">
64        <div class="titlepage">
65          <div>
66            <div>
67              <h3 class="title"><a id="id1669076"></a>Parameters</h3>
68            </div>
69          </div>
70        </div>
71        <div class="sect3" lang="en" xml:lang="en">
72          <div class="titlepage">
73            <div>
74              <div>
75                <h4 class="title"><a id="id1669188"></a>flags</h4>
76              </div>
77            </div>
78          </div>
79          <p>
80                          The <span class="bold"><strong>flags</strong></span> parameter must be set by
81                          bitwise inclusively <span class="bold"><strong>OR</strong></span>'ing together
82                          one or more of the following values:
83                     </p>
84          <div class="itemizedlist">
85            <ul type="disc">
86              <li>
87                <p><a id="envset_flags_DB_AUTO_COMMIT"></a>
88                  <code class="literal">DB_AUTO_COMMIT</code>
89            </p>
90                <p>
91                 If set, <a class="link" href="db.html" title="Chapter��2.�� The DB Handle">DB</a>  handle
92                 operations for which no explicit transaction handle was specified, and
93                 which modify databases in the database environment, will be
94                 automatically enclosed within a transaction.
95            </p>
96                <p>
97                 Calling <code class="methodname">DB_ENV-&gt;set_flags()</code> with this flag only affects the specified 
98                 <a class="link" href="env.html" title="Chapter��5.�� The DB_ENV Handle">DB_ENV</a>  handle (and any other
99                 Berkeley DB handles opened within the scope of that handle). For
100                 consistent behavior across the environment, all 
101                 <a class="link" href="env.html" title="Chapter��5.�� The DB_ENV Handle">DB_ENV</a>  handles opened in the
102                 environment must either set this flag
103                 or the flag should be specified in the <a href="../../programmer_reference/env_db_config.html#env_db_config.DB_CONFIG" class="olink">DB_CONFIG</a>
104                 configuration file.
105            </p>
106                <p>
107                 This flag may be used to configure Berkeley DB at any time during the life
108                 of the application.
109            </p>
110              </li>
111              <li>
112                <p><a id="set_flags_DB_CDB_ALLDB"></a>
113                  <code class="literal">DB_CDB_ALLDB</code>
114            </p>
115                <p>
116                 If set, Berkeley DB Concurrent Data Store applications will perform
117                 locking on an environment-wide basis rather than on a per-database
118                 basis.
119            </p>
120                <p>
121                 Calling <code class="methodname">DB_ENV-&gt;set_flags()</code> with the DB_CDB_ALLDB flag only affects
122                 the specified <a class="link" href="env.html" title="Chapter��5.�� The DB_ENV Handle">DB_ENV</a> 
123                 handle (and any other Berkeley DB handles opened within the scope of
124                 that handle). For consistent behavior across the environment, all
125                 <a class="link" href="env.html" title="Chapter��5.�� The DB_ENV Handle">DB_ENV</a>  handles opened in
126                 the environment must either set the DB_CDB_ALLDB flag or the flag
127                 should be specified in the <a href="../../programmer_reference/env_db_config.html#env_db_config.DB_CONFIG" class="olink">DB_CONFIG</a>
128                 configuration file.
129            </p>
130                <p>
131                 The DB_CDB_ALLDB flag may be used to configure Berkeley DB only before
132                 the <a class="xref" href="envopen.html" title="DB_ENV-&gt;open()">DB_ENV-&gt;open()</a>  method
133                 is called.
134            </p>
135              </li>
136              <li>
137                <p><a id="set_flags_DB_DIRECT_DB"></a>
138                  <code class="literal">DB_DIRECT_DB</code>
139            </p>
140                <p>
141                 Turn off system buffering of Berkeley DB database files to avoid
142                 double caching.
143            </p>
144                <p>
145                 Calling <code class="methodname">DB_ENV-&gt;set_flags()</code> with the DB_DIRECT_DB flag only affects
146                 the specified <a class="link" href="env.html" title="Chapter��5.�� The DB_ENV Handle">DB_ENV</a> 
147                 handle (and any other Berkeley DB handles opened within the scope of
148                 that handle). For consistent behavior across the environment, all
149                 <a class="link" href="env.html" title="Chapter��5.�� The DB_ENV Handle">DB_ENV</a>  handles opened in
150                 the environment must either set the DB_DIRECT_DB flag or the flag
151                 should be specified in the <a href="../../programmer_reference/env_db_config.html#env_db_config.DB_CONFIG" class="olink">DB_CONFIG</a>
152                 configuration file.
153            </p>
154                <p>
155                 The DB_DIRECT_DB flag may be used to configure Berkeley DB at any time
156                 during the life of the application.
157            </p>
158              </li>
159              <li>
160                <p><a id="set_flags_DB_DSYNC_DB"></a>
161                  <code class="literal">DB_DSYNC_DB</code>
162            </p>
163                <p>
164                 Configure Berkeley DB to flush database writes to the backing disk
165                 before returning from the write system call, rather than flushing
166                 database writes explicitly in a separate system call, as necessary. 
167                 This is only available on some systems (for example, systems
168                 supporting the IEEE/ANSI Std 1003.1 (POSIX) standard O_DSYNC flag, or
169                 systems supporting the Windows FILE_FLAG_WRITE_THROUGH flag).  This
170                 flag may result in inaccurate file modification times and other
171                 file-level information for Berkeley DB database files.  This flag will
172                 almost certainly result in a performance decrease on most systems. 
173                 This flag is only applicable to certain filesysystems (for example, the
174                 Veritas VxFS filesystem), where the filesystem's support for trickling
175                 writes back to stable storage behaves badly (or more likely, has been
176                 misconfigured).
177            </p>
178                <p>
179                 Calling <code class="methodname">DB_ENV-&gt;set_flags()</code> with the DB_DSYNC_DB flag only affects
180                 the specified <a class="link" href="env.html" title="Chapter��5.�� The DB_ENV Handle">DB_ENV</a> 
181                 handle (and any other Berkeley DB handles opened within the scope of
182                 that handle). For consistent behavior across the environment, all
183                 <a class="link" href="env.html" title="Chapter��5.�� The DB_ENV Handle">DB_ENV</a>  handles opened in
184                 the environment must either set the DB_DSYNC_DB flag or the flag
185                 should be specified in the <a href="../../programmer_reference/env_db_config.html#env_db_config.DB_CONFIG" class="olink">DB_CONFIG</a>
186                 configuration file.
187            </p>
188                <p>
189                 The DB_DSYNC_DB flag may be used to configure Berkeley DB at any time
190                 during the life of the application.
191            </p>
192              </li>
193              <li>
194                <p><a id="set_flags_DB_MULTIVERSION"></a>
195                  <code class="literal">DB_MULTIVERSION</code>
196            </p>
197                <p>
198                 If set, all databases in the environment will be opened as if
199                 DB_MULTIVERSION is passed to the <a class="xref" href="dbopen.html" title="DB-&gt;open()">DB-&gt;open()</a>
200                 method.  This flag will be ignored for queue databases for which DB_MULTIVERSION is not
201                 supported.
202            </p>
203                <p>
204                 Calling <code class="methodname">DB_ENV-&gt;set_flags()</code> with the DB_MULTIVERSION flag only
205                 affects the specified <a class="link" href="env.html" title="Chapter��5.�� The DB_ENV Handle">DB_ENV</a>  handle (and any other
206                 Berkeley DB handles opened within the scope of that handle). For
207                 consistent behavior across the environment, all <a class="link" href="env.html" title="Chapter��5.�� The DB_ENV Handle">DB_ENV</a>  
208                 handles opened in the environment must either set the DB_MULTIVERSION flag or the flag
209                 should be specified in the <a href="../../programmer_reference/env_db_config.html#env_db_config.DB_CONFIG" class="olink">DB_CONFIG</a>
210                 configuration file.
211            </p>
212                <p>
213                 The DB_MULTIVERSION flag may be used to configure Berkeley DB at any
214                 time during the life of the application.
215            </p>
216              </li>
217              <li>
218                <p><a id="set_flags_DB_NOLOCKING"></a>
219                  <code class="literal">DB_NOLOCKING</code>
220            </p>
221                <p>
222                 If set, Berkeley DB will grant all requested mutual exclusion mutexes
223                 and database locks without regard for their actual availability.  This
224                 functionality should never be used for purposes other than debugging.
225            </p>
226                <p>
227                 Calling <code class="methodname">DB_ENV-&gt;set_flags()</code> with the DB_NOLOCKING flag only affects
228                 the specified <a class="link" href="env.html" title="Chapter��5.�� The DB_ENV Handle">DB_ENV</a> 
229                 handle (and any other Berkeley DB handles opened within the scope of
230                 that handle).
231            </p>
232                <p>
233                 The DB_NOLOCKING flag may be used to configure Berkeley DB at any time
234                 during the life of the application.
235            </p>
236              </li>
237              <li>
238                <p><a id="set_flags_DB_NOMMAP"></a>
239                  <code class="literal">DB_NOMMAP</code>
240            </p>
241                <p>
242                 If set, Berkeley DB will copy read-only database files into the local
243                 cache instead of potentially mapping them into process memory (see the
244                 description of the <a class="xref" href="envset_mp_mmapsize.html" title="DB_ENV-&gt;set_mp_mmapsize()">DB_ENV-&gt;set_mp_mmapsize()</a> 
245                 method for further information).
246            </p>
247                <p>
248                 Calling <code class="methodname">DB_ENV-&gt;set_flags()</code> with the DB_NOMMAP flag only affects the
249                 specified <a class="link" href="env.html" title="Chapter��5.�� The DB_ENV Handle">DB_ENV</a>  handle
250                 (and any other Berkeley DB handles opened within the scope of that
251                 handle). For consistent behavior across the environment, all 
252                 <a class="link" href="env.html" title="Chapter��5.�� The DB_ENV Handle">DB_ENV</a>  handles opened in the
253                 environment must either set the DB_NOMMAP flag or the flag should be
254                 specified in the <a href="../../programmer_reference/env_db_config.html#env_db_config.DB_CONFIG" class="olink">DB_CONFIG</a>
255                 configuration file.
256            </p>
257                <p>
258                 The DB_NOMMAP flag may be used to configure Berkeley DB at any time
259                 during the life of the application.
260            </p>
261              </li>
262              <li>
263                <p><a id="set_flags_DB_NOPANIC"></a>
264                  <code class="literal">DB_NOPANIC</code>
265            </p>
266                <p>
267                 If set, Berkeley DB will ignore any panic state in the database
268                 environment. (Database environments in a panic state normally refuse
269                 all attempts to call Berkeley DB functions, returning <a href="../../programmer_reference/program_errorret.html#program_errorret.DB_RUNRECOVERY" class="olink">DB_RUNRECOVERY</a>.)
270                 This functionality should never be used for purposes other than
271                 debugging.
272            </p>
273                <p>
274                 Calling <code class="methodname">DB_ENV-&gt;set_flags()</code> with the DB_NOPANIC flag only affects the
275                 specified <a class="link" href="env.html" title="Chapter��5.�� The DB_ENV Handle">DB_ENV</a>  handle
276                 (and any other Berkeley DB handles opened within the scope of that
277                 handle).
278            </p>
279                <p>
280                 The DB_NOPANIC flag may be used to configure Berkeley DB at any time
281                 during the life of the application.
282            </p>
283              </li>
284              <li>
285                <p><a id="set_flags_DB_OVERWRITE"></a>
286                  <code class="literal">DB_OVERWRITE</code>
287            </p>
288                <p>
289                 Overwrite files stored in encrypted formats before deleting them. 
290                 Berkeley DB overwrites files using alternating 0xff, 0x00 and 0xff
291                 byte patterns. For file overwriting to be effective, the underlying
292                 file must be stored on a fixed-block filesystem.  Systems with
293                 journaling or logging filesystems will require operating system
294                 support and probably modification of the Berkeley DB sources.
295            </p>
296                <p>
297                 Calling <code class="methodname">DB_ENV-&gt;set_flags()</code> with the DB_OVERWRITE flag only affects
298                 the specified <a class="link" href="env.html" title="Chapter��5.�� The DB_ENV Handle">DB_ENV</a> 
299                 handle (and any other Berkeley DB handles opened within the scope of
300                 that handle).
301            </p>
302                <p>
303                 The DB_OVERWRITE flag may be used to configure Berkeley DB at any time
304                 during the life of the application.
305            </p>
306              </li>
307              <li>
308                <p><a id="set_flags_DB_PANIC_ENVIRONMENT"></a>
309                  <code class="literal">DB_PANIC_ENVIRONMENT</code>
310            </p>
311                <p>
312                 If set, Berkeley DB will set the panic state for the database
313                 environment. (Database environments in a panic state normally refuse
314                 all attempts to call Berkeley DB functions, returning <a href="../../programmer_reference/program_errorret.html#program_errorret.DB_RUNRECOVERY" class="olink">DB_RUNRECOVERY</a>.)
315                 This flag may not be specified using the environment's <a href="../../programmer_reference/env_db_config.html#env_db_config.DB_CONFIG" class="olink">DB_CONFIG</a> file.
316            </p>
317                <p>
318                 Calling <code class="methodname">DB_ENV-&gt;set_flags()</code> with the DB_PANIC_ENVIRONMENT flag
319                 affects the database environment, including all threads of control
320                 accessing the database environment.
321            </p>
322                <p>
323                 The DB_PANIC_ENVIRONMENT flag may be used to configure Berkeley DB
324                 only after the <a class="xref" href="envopen.html" title="DB_ENV-&gt;open()">DB_ENV-&gt;open()</a>  method is called.
325            </p>
326              </li>
327              <li>
328                <p><a id="set_flags_DB_REGION_INIT"></a>
329                  <code class="literal">DB_REGION_INIT</code>
330            </p>
331                <p>
332                 In some applications, the expense of page-faulting the underlying
333                 shared memory regions can affect performance.  (For example, if the
334                 page-fault occurs while holding a lock, other lock requests can
335                 convoy, and overall throughput may decrease.)  If set, Berkeley DB
336                 will page-fault shared regions into memory when initially creating or
337                 joining a Berkeley DB environment.  In addition, Berkeley DB will
338                 write the shared regions when creating an environment, forcing the
339                 underlying virtual memory and filesystems to instantiate both the
340                 necessary memory and the necessary disk space. This can also avoid
341                 out-of-disk space failures later on.
342            </p>
343                <p>
344                 Calling <code class="methodname">DB_ENV-&gt;set_flags()</code> with the DB_REGION_INIT flag only affects
345                 the specified <a class="link" href="env.html" title="Chapter��5.�� The DB_ENV Handle">DB_ENV</a> 
346                 handle (and any other Berkeley DB handles opened within the scope of
347                 that handle). For consistent behavior across the environment, all
348                 <a class="link" href="env.html" title="Chapter��5.�� The DB_ENV Handle">DB_ENV</a>  handles opened in
349                 the environment must either set the DB_REGION_INIT flag or the flag
350                 should be specified in the <a href="../../programmer_reference/env_db_config.html#env_db_config.DB_CONFIG" class="olink">DB_CONFIG</a>
351                 configuration file.
352            </p>
353                <p>
354                 The DB_REGION_INIT flag may be used to configure Berkeley DB at any
355                 time during the life of the application.
356            </p>
357              </li>
358              <li>
359                <p><a id="envset_flags_DB_TIME_NOTGRANTED"></a>
360                  <code class="literal">DB_TIME_NOTGRANTED</code>
361            </p>
362                <p>
363                 If set, database calls timing out based on lock or transaction timeout
364                 values will return <a href="../../programmer_reference/program_errorret.html#program_errorret.DB_LOCK_NOTGRANTED" class="olink">DB_LOCK_NOTGRANTED</a>
365                 instead of <a href="../../programmer_reference/program_errorret.html#program_errorret.DB_LOCK_DEADLOCK" class="olink">DB_LOCK_DEADLOCK</a>.
366                 This allows applications to distinguish between operations which have
367                 deadlocked and operations which have exceeded their time limits.
368            </p>
369                <p>
370                 Calling <code class="methodname">DB_ENV-&gt;set_flags()</code> with the DB_TIME_NOTGRANTED flag only
371                 affects the specified <a class="link" href="env.html" title="Chapter��5.�� The DB_ENV Handle">DB_ENV</a>  handle (and any other
372                 Berkeley DB handles opened within the scope of that handle). For
373                 consistent behavior across the environment, all 
374                 <a class="link" href="env.html" title="Chapter��5.�� The DB_ENV Handle">DB_ENV</a>  handles opened in the
375                 environment must either set the DB_TIME_NOTGRANTED flag or the flag
376                 should be specified in the <a href="../../programmer_reference/env_db_config.html#env_db_config.DB_CONFIG" class="olink">DB_CONFIG</a>
377                 configuration file.
378            </p>
379                <p>
380                The <code class="literal">DB_TIME_NOTGRANTED</code> flag may be used to configure Berkeley DB at
381                 any time during the life of the application.
382            </p>
383                <p>
384                Note that the <a class="xref" href="lockget.html" title="DB_ENV-&gt;lock_get()">DB_ENV-&gt;lock_get()</a>
385                and <a class="xref" href="lockvec.html" title="DB_ENV-&gt;lock_vec()">DB_ENV-&gt;lock_vec()</a>
386                methods are unaffected by this flag.
387            </p>
388              </li>
389              <li>
390                <p><a id="envset_flags_DB_TXN_NOSYNC"></a>
391                  <code class="literal">DB_TXN_NOSYNC</code>
392            </p>
393                <p>
394                 If set, Berkeley DB will not write or synchronously flush the log on
395                 transaction commit. This means that transactions exhibit the ACI
396                 (atomicity, consistency, and isolation) properties, but not D
397                 (durability); that is, database integrity will be maintained, but if
398                 the application or system fails, it is possible some number of the
399                 most recently committed transactions may be undone during recovery. 
400                 The number of transactions at risk is governed by how many log updates
401                 can fit into the log buffer, how often the operating system flushes
402                 dirty buffers to disk, and how often the log is checkpointed.
403            </p>
404                <p>
405                 Calling <code class="methodname">DB_ENV-&gt;set_flags()</code> with the DB_TXN_NOSYNC flag only affects
406                 the specified <a class="link" href="env.html" title="Chapter��5.�� The DB_ENV Handle">DB_ENV</a> 
407                 handle (and any other Berkeley DB handles opened within the scope of
408                 that handle). For consistent behavior across the environment, all
409                 <a class="link" href="env.html" title="Chapter��5.�� The DB_ENV Handle">DB_ENV</a>  handles opened in
410                 the environment must either set the DB_TXN_NOSYNC flag or the flag
411                 should be specified in the <a href="../../programmer_reference/env_db_config.html#env_db_config.DB_CONFIG" class="olink">DB_CONFIG</a>
412                 configuration file.
413            </p>
414                <p>
415                 The DB_TXN_NOSYNC flag may be used to configure Berkeley DB at any
416                 time during the life of the application.
417            </p>
418              </li>
419              <li>
420                <p><a id="set_flags_DB_TXN_NOWAIT"></a>
421                  <code class="literal">DB_TXN_NOWAIT</code>
422            </p>
423                <p>
424                 If set and a lock is unavailable for any Berkeley DB operation
425                 performed in the context of a transaction, cause the operation to
426                 return <a href="../../programmer_reference/program_errorret.html#program_errorret.DB_LOCK_DEADLOCK" class="olink">DB_LOCK_DEADLOCK</a>
427                 (or <a href="../../programmer_reference/program_errorret.html#program_errorret.DB_LOCK_NOTGRANTED" class="olink">DB_LOCK_NOTGRANTED</a>
428                 if configured using the DB_TIME_NOTGRANTED flag).
429            </p>
430                <p>
431                 Calling <code class="methodname">DB_ENV-&gt;set_flags()</code> with the DB_TXN_NOWAIT flag only affects
432                 the specified <a class="link" href="env.html" title="Chapter��5.�� The DB_ENV Handle">DB_ENV</a> 
433                 handle (and any other Berkeley DB handles opened within the scope of
434                 that handle). For consistent behavior across the environment, all
435                 <a class="link" href="env.html" title="Chapter��5.�� The DB_ENV Handle">DB_ENV</a>  handles opened in
436                 the environment must either set the DB_TXN_NOWAIT flag or the flag
437                 should be specified in the <a href="../../programmer_reference/env_db_config.html#env_db_config.DB_CONFIG" class="olink">DB_CONFIG</a>
438                 configuration file.
439            </p>
440                <p>
441                 The DB_TXN_NOWAIT flag may be used to configure Berkeley DB at any
442                 time during the life of the application.
443            </p>
444              </li>
445              <li>
446                <p><a id="set_flags_DB_TXN_SNAPSHOT"></a>
447                  <code class="literal">DB_TXN_SNAPSHOT</code>
448            </p>
449                <p>
450                 If set, all transactions in the environment will be started as if
451                 DB_TXN_SNAPSHOT were passed to the 
452                 <a class="xref" href="txnbegin.html" title="DB_ENV-&gt;txn_begin()">DB_ENV-&gt;txn_begin()</a> method, and all
453                 non-transactional cursors will be opened as if DB_TXN_SNAPSHOT were
454                 passed to the <a class="xref" href="dbcursor.html" title="DB-&gt;cursor()">DB-&gt;cursor()</a> method.
455            </p>
456                <p>
457                 Calling <code class="methodname">DB_ENV-&gt;set_flags()</code> with the DB_TXN_SNAPSHOT flag only
458                 affects the specified <a class="link" href="env.html" title="Chapter��5.�� The DB_ENV Handle">DB_ENV</a>  
459                 handle (and any other Berkeley DB handles opened within the scope of that handle). For
460                 consistent behavior across the environment, all 
461                 <a class="link" href="env.html" title="Chapter��5.�� The DB_ENV Handle">DB_ENV</a>  handles opened in the
462                 environment must either set the DB_TXN_SNAPSHOT flag or the flag
463                 should be specified in the <a href="../../programmer_reference/env_db_config.html#env_db_config.DB_CONFIG" class="olink">DB_CONFIG</a>
464                 configuration file.
465            </p>
466                <p>
467                 The DB_TXN_SNAPSHOT flag may be used to configure Berkeley DB at any
468                 time during the life of the application.
469            </p>
470              </li>
471              <li>
472                <p><a id="set_flags_DB_TXN_WRITE_NOSYNC"></a>
473                  <code class="literal">DB_TXN_WRITE_NOSYNC</code>
474            </p>
475                <p>
476                 If set, Berkeley DB will write, but will not synchronously flush, the
477                 log on transaction commit. This means that transactions exhibit the
478                 ACI (atomicity, consistency, and isolation) properties, but not D
479                 (durability); that is, database integrity will be maintained, but if
480                 the system fails, it is possible some number of the most recently
481                 committed transactions may be undone during recovery.  The number of
482                 transactions at risk is governed by how often the system flushes dirty
483                 buffers to disk and how often the log is checkpointed.
484            </p>
485                <p>
486                 Calling <code class="methodname">DB_ENV-&gt;set_flags()</code> with the DB_TXN_WRITE_NOSYNC flag only
487                 affects the specified <a class="link" href="env.html" title="Chapter��5.�� The DB_ENV Handle">DB_ENV</a>  
488                 handle (and any other Berkeley DB handles opened within the scope of that handle). For
489                 consistent behavior across the environment, all 
490                 <a class="link" href="env.html" title="Chapter��5.�� The DB_ENV Handle">DB_ENV</a>  handles opened in the
491                 environment must either set the DB_TXN_WRITE_NOSYNC flag or the flag
492                 should be specified in the <a href="../../programmer_reference/env_db_config.html#env_db_config.DB_CONFIG" class="olink">DB_CONFIG</a>
493                 configuration file.
494            </p>
495                <p>
496                 The DB_TXN_WRITE_NOSYNC flag may be used to configure Berkeley DB at
497                 any time during the life of the application.
498            </p>
499              </li>
500              <li>
501                <p><a id="set_flags_DB_YIELDCPU"></a>
502                  <code class="literal">DB_YIELDCPU</code>
503            </p>
504                <p>
505                 If set, Berkeley DB will yield the processor immediately after each
506                 page or mutex acquisition.  This functionality should never be used
507                 for purposes other than stress testing.
508            </p>
509                <p>
510                 Calling <code class="methodname">DB_ENV-&gt;set_flags()</code> with the DB_YIELDCPU flag only affects
511                 the specified <a class="link" href="env.html" title="Chapter��5.�� The DB_ENV Handle">DB_ENV</a> 
512                 handle (and any other Berkeley DB handles opened within the scope of
513                 that handle). For consistent behavior across the environment, all
514                 <a class="link" href="env.html" title="Chapter��5.�� The DB_ENV Handle">DB_ENV</a>  handles opened in
515                 the environment must either set the DB_YIELDCPU flag or the flag
516                 should be specified in the <a href="../../programmer_reference/env_db_config.html#env_db_config.DB_CONFIG" class="olink">DB_CONFIG</a>
517                 configuration file.
518            </p>
519                <p>
520                 The DB_YIELDCPU flag may be used to configure Berkeley DB at any time
521                 during the life of the application.
522            </p>
523              </li>
524            </ul>
525          </div>
526        </div>
527        <div class="sect3" lang="en" xml:lang="en">
528          <div class="titlepage">
529            <div>
530              <div>
531                <h4 class="title"><a id="id1670622"></a>onoff</h4>
532              </div>
533            </div>
534          </div>
535          <p>
536                          If the <span class="bold"><strong>onoff</strong></span> parameter is zero, the
537                          specified flags are cleared; otherwise they are set.
538                     </p>
539        </div>
540      </div>
541      <div class="sect2" lang="en" xml:lang="en">
542        <div class="titlepage">
543          <div>
544            <div>
545              <h3 class="title"><a id="id1669640"></a>Errors</h3>
546            </div>
547          </div>
548        </div>
549        <p>
550                         The <code class="methodname">DB_ENV-&gt;set_flags()</code> <span>
551            <span>
552                 method may fail and return one of the following non-zero errors:
553            </span>
554            
555        </span>
556                    </p>
557        <div class="sect3" lang="en" xml:lang="en">
558          <div class="titlepage">
559            <div>
560              <div>
561                <h4 class="title"><a id="id1670196"></a>EINVAL</h4>
562              </div>
563            </div>
564          </div>
565          <p>
566                An invalid flag value or parameter was specified.
567            </p>
568        </div>
569      </div>
570      <div class="sect2" lang="en" xml:lang="en">
571        <div class="titlepage">
572          <div>
573            <div>
574              <h3 class="title"><a id="id1669797"></a>Class</h3>
575            </div>
576          </div>
577        </div>
578        <p>
579                <a class="link" href="env.html" title="Chapter��5.�� The DB_ENV Handle">DB_ENV</a>  
580            </p>
581      </div>
582      <div class="sect2" lang="en" xml:lang="en">
583        <div class="titlepage">
584          <div>
585            <div>
586              <h3 class="title"><a id="id1669881"></a>See Also</h3>
587            </div>
588          </div>
589        </div>
590        <p>
591                     <a class="xref" href="env.html#envlist" title="Database Environments and Related Methods">Database Environments and Related Methods</a> 
592                </p>
593      </div>
594    </div>
595    <div class="navfooter">
596      <hr />
597      <table width="100%" summary="Navigation footer">
598        <tr>
599          <td width="40%" align="left"><a accesskey="p" href="envset_feedback.html">Prev</a>��</td>
600          <td width="20%" align="center">
601            <a accesskey="u" href="env.html">Up</a>
602          </td>
603          <td width="40%" align="right">��<a accesskey="n" href="envset_intermediate_dir_mode.html">Next</a></td>
604        </tr>
605        <tr>
606          <td width="40%" align="left" valign="top">DB_ENV-&gt;set_feedback()��</td>
607          <td width="20%" align="center">
608            <a accesskey="h" href="index.html">Home</a>
609          </td>
610          <td width="40%" align="right" valign="top">��DB_ENV-&gt;set_intermediate_dir_mode()</td>
611        </tr>
612      </table>
613    </div>
614  </body>
615</html>
616