File: envopen.html

package info (click to toggle)
db 5.1.29-9%2Bdeb8u1
  • links: PTS, VCS
  • area: main
  • in suites: jessie
  • size: 150,396 kB
  • sloc: ansic: 400,169; java: 94,399; tcl: 70,967; sh: 37,399; cs: 30,758; cpp: 21,132; perl: 14,227; xml: 9,854; makefile: 3,777; yacc: 1,003; awk: 942; sql: 801; erlang: 461; python: 216; php: 24; asm: 14
file content (639 lines) | stat: -rw-r--r-- 37,096 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>DbEnv::open()</title>
    <link rel="stylesheet" href="apiReference.css" type="text/css" />
    <meta name="generator" content="DocBook XSL Stylesheets V1.73.2" />
    <link rel="start" href="index.html" title="Berkeley DB C++ API Reference" />
    <link rel="up" href="env.html" title="Chapter 5.  The DbEnv Handle" />
    <link rel="prev" href="envlsn_reset.html" title="DbEnv::lsn_reset()" />
    <link rel="next" href="envremove.html" title="DbEnv::remove()" />
  </head>
  <body>
    <div class="navheader">
      <table width="100%" summary="Navigation header">
        <tr>
          <th colspan="3" align="center">DbEnv::open()</th>
        </tr>
        <tr>
          <td width="20%" align="left"><a accesskey="p" href="envlsn_reset.html">Prev</a> </td>
          <th width="60%" align="center">Chapter 5. 
                The DbEnv Handle
        </th>
          <td width="20%" align="right"> <a accesskey="n" href="envremove.html">Next</a></td>
        </tr>
      </table>
      <hr />
    </div>
    <div class="sect1" lang="en" xml:lang="en">
      <div class="titlepage">
        <div>
          <div>
            <h2 class="title" style="clear: both"><a id="envopen"></a>DbEnv::open()</h2>
          </div>
        </div>
      </div>
      <pre class="programlisting">#include &lt;db_cxx.h&gt;

int
DbEnv::open(const char *db_home, u_int32_t flags, int mode); </pre>
      <p>
         The <code class="methodname">DbEnv::open()</code> 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.
    </p>
      <p>
         The <code class="methodname">DbEnv::open()</code> method <span>
            
            <span>
                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.
            </span>
        </span>
         If <code class="methodname">DbEnv::open()</code> fails, the 
         <a class="xref" href="envclose.html" title="DbEnv::close()">DbEnv::close()</a>  method must be
         called to discard the <a class="link" href="env.html" title="Chapter 5.  The DbEnv Handle">DbEnv</a>  handle.
    </p>
      <div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
        <h3 class="title">Warning</h3>
        <p>
            Using environments with some journaling filesystems might
            result in log file corruption. This can occur if the operating
            system experiences an unclean shutdown when a log file is being
            created.  Please see  
            <a href="../../programmer_reference/transapp_journal.html" class="olink">Using
                Recovery on Journaling Filesystems</a>
            in the <em class="citetitle">Berkeley DB Programmer's Reference Guide</em> for more information.
        </p>
      </div>
      <div class="sect2" lang="en" xml:lang="en">
        <div class="titlepage">
          <div>
            <div>
              <h3 class="title"><a id="idp51819184"></a>Parameters</h3>
            </div>
          </div>
        </div>
        <div class="sect3" lang="en" xml:lang="en">
          <div class="titlepage">
            <div>
              <div>
                <h4 class="title"><a id="idp51757792"></a>db_home</h4>
              </div>
            </div>
          </div>
          <p>
                          The <span class="bold"><strong>db_home</strong></span> parameter is the database
                          environment's home directory.  For more information on <span class="bold"><strong>db_home</strong></span>, and filename resolution in general,
                          see <a href="../../programmer_reference/env_naming.html" class="olink">Berkeley DB File Naming</a>.  The environment variable <span class="bold"><strong>DB_HOME</strong></span> may be used as the path of the database
                          home, as described in <a href="../../programmer_reference/env_naming.html" class="olink">Berkeley DB File Naming</a>.
                     </p>
          <p>
                         When using a Unicode build on Windows (the default), the 
                         <span class="bold"><strong>db_home</strong></span> argument
                         will be interpreted as a UTF-8 string, which is equivalent to ASCII for
                         Latin characters.
                     </p>
        </div>
        <div class="sect3" lang="en" xml:lang="en">
          <div class="titlepage">
            <div>
              <div>
                <h4 class="title"><a id="idp51760888"></a>flags</h4>
              </div>
            </div>
          </div>
          <p>
                        The <span class="bold"><strong>flags</strong></span> parameter specifies the subsystems that are 
                        initialized and how the application's environment affects Berkeley DB file naming, 
                        among other things. The <span class="bold"><strong>flags</strong></span> parameter must be set to 0 or by
                        bitwise inclusively <span class="bold"><strong>OR</strong></span>'ing together one or more of the values
                        described in this section.
                </p>
          <p>
                    Because there are a large number of flags that can be specified, they have been grouped together by
                    functionality. The first group of flags indicates which of the Berkeley DB subsystems should be
                    initialized.
                </p>
          <p>
                        The choice of subsystems initialized for a Berkeley DB database environment is specified by the
                        thread of control initially creating the environment. Any subsequent thread of control joining
                        the environment will automatically be configured to use the same subsystems as were created in
                        the environment (unless the thread of control requests a subsystem not available in the
                        environment, which will fail). Applications joining an environment, able to adapt to whatever
                        subsystems have been configured in the environment, should open the environment without
                        specifying any subsystem flags. Applications joining an environment, requiring specific
                        subsystems from their environments, should open the environment specifying those specific
                        subsystem flags.
                </p>
          <div class="itemizedlist">
            <ul type="disc">
              <li>
                <p><a id="envopen_DB_INIT_CDB"></a>
                                         <code class="literal">DB_INIT_CDB</code>
                                </p>
                <p>
                                        Initialize locking for the 
                                        <a href="../../programmer_reference/cam.html#cam_intro" class="olink">Berkeley DB Concurrent Data Store</a> 
                                        product. In this mode,
                                    Berkeley DB provides multiple reader/single writer access. The only other subsystem
                                    that should be specified with the <code class="literal">DB_INIT_CDB</code> flag is 
                                    <code class="literal">DB_INIT_MPOOL</code>.
                                </p>
              </li>
              <li>
                <p><a id="envopen_DB_INIT_LOCK"></a>
                                         <code class="literal">DB_INIT_LOCK</code>
                                </p>
                <p>
                                        Initialize the locking subsystem. This subsystem should be used when multiple
                                        processes or threads are going to be reading and writing a Berkeley DB database,
                                        so that they do not interfere with each other. If all threads are accessing the
                                        database(s) read-only, locking is unnecessary. When the DB_INIT_LOCK flag is
                                        specified, it is usually necessary to run a deadlock detector, as well. See
                                        <a class="link" href="db_deadlock.html" title="db_deadlock">db_deadlock</a> and 
                                        <a class="xref" href="lockdetect.html" title="DbEnv::lock_detect()">DbEnv::lock_detect()</a>  
                                        for more information.
                                </p>
              </li>
              <li>
                <p><a id="envopen_DB_INIT_LOG"></a>
                                         <code class="literal">DB_INIT_LOG</code>
                                </p>
                <p>
                                        Initialize the logging subsystem. This subsystem should be used when recovery
                                        from application or system failure is necessary. If the log region is being
                                        created and log files are already present, the log files are reviewed;
                                        subsequent log writes are appended to the end of the log, rather than
                                        overwriting current log entries.
                                </p>
              </li>
              <li>
                <p><a id="envopen_DB_INIT_MPOOL"></a>
                                         <code class="literal">DB_INIT_MPOOL</code>
                                </p>
                <p>
                                        Initialize the shared memory buffer pool subsystem. This subsystem should be
                                        used whenever an application is using any Berkeley DB access method.
                                </p>
              </li>
              <li>
                <p><a id="envopen_DB_INIT_REP"></a>
                                         <code class="literal">DB_INIT_REP</code>
                                </p>
                <p>
                                        Initialize the replication subsystem. This subsystem should be used whenever an
                                        application plans on using replication. The <code class="literal">DB_INIT_REP</code> 
                                        flag requires the
                                        <code class="literal">DB_INIT_TXN</code> and <code class="literal">DB_INIT_LOCK</code> 
                                        flags also be configured.
                                </p>
                <p>
                                        You can also specify this flag in the 
										<a href="../../programmer_reference/env_db_config.html#env_db_config.DB_CONFIG" class="olink">DB_CONFIG</a>
										configuration file. The syntax is a single line with the string "set_open_flags",
										one or more whitespace characters, the string "DB_INIT_REP", 
										optionally one or more whitespace characters and the string "on" or "off". If the optional
										string is omitted, the default is "on"; for example, "set_open_flags DB_INIT_REP" or "set_open_flags DB_INIT_REP on". 
										Because the DB_CONFIG file is read when the database environment is
										opened, it will silently overrule configuration done before that time.
                                </p>
              </li>
              <li>
                <p><a id="envopen_DB_INIT_TXN"></a>
                                         <code class="literal">DB_INIT_TXN</code>
                                </p>
                <p>
                                        Initialize the transaction subsystem. This subsystem should be used when
                                        recovery and atomicity of multiple operations are important. The 
                                        <code class="literal">DB_INIT_TXN</code> flag implies the 
                                        <code class="literal">DB_INIT_LOG</code> flag.
                                </p>
              </li>
            </ul>
          </div>
          <p>
                        The second group of flags govern what recovery, if any, is performed when the environment is
                        initialized:
                </p>
          <div class="itemizedlist">
            <ul type="disc">
              <li>
                <p><a id="envopen_DB_RECOVER"></a>
                                         <code class="literal">DB_RECOVER</code>
                                </p>
                <p>
                                        Run normal recovery on this environment before opening it for normal use. If
                                        this flag is set, the <code class="literal">DB_CREATE</code> and 
                                        <code class="literal">DB_INIT_TXN</code> flags must also be set, because
                                        the regions will be removed and re-created, and transactions are required for
                                        application recovery.
                                </p>
              </li>
              <li>
                <p><a id="envopen_DB_RECOVER_FATAL"></a>
                                         <code class="literal">DB_RECOVER_FATAL</code>
                                </p>
                <p>
                                        Run catastrophic recovery on this environment before opening it for normal use.
                                        If this flag is set, the <code class="literal">DB_CREATE</code> and 
                                        <code class="literal">DB_INIT_TXN</code> flags must also be set,
                                        because the regions will be removed and re-created, and transactions are
                                        required for application recovery.
                                </p>
              </li>
            </ul>
          </div>
          <p>
                        A standard part of the recovery process is to remove the existing Berkeley DB environment and
                        create a new one in which to perform recovery. If the thread of control performing recovery does
                        not specify the correct region initialization information (for example, the correct memory pool
                        cache size), the result can be an application running in an environment with incorrect cache and
                        other subsystem sizes. For this reason, the thread of control performing recovery should specify
                        correct configuration information before calling the <code class="methodname">DbEnv::open()</code> method; or it should remove
                        the environment after recovery is completed, leaving creation of the correctly sized environment
                        to a subsequent call to the <code class="methodname">DbEnv::open()</code> method.
                </p>
          <p>
                        All Berkeley DB recovery processing must be single-threaded; that is, only a single thread of
                        control may perform recovery or access a Berkeley DB environment while recovery is being
                        performed. Because it is not an error to specify <code class="literal">DB_RECOVER</code> for an 
                        environment for which no recovery is required, it is reasonable programming practice for 
                        the thread of control responsible for performing recovery and creating the environment to 
                        always specify the <code class="literal">DB_CREATE</code> and <code class="literal">DB_RECOVER</code> flags 
                        during startup.
                </p>
          <p>
                        The third group of flags govern file-naming extensions in the environment:
                </p>
          <div class="itemizedlist">
            <ul type="disc">
              <li>
                <p><a id="envopen_DB_USE_ENVIRON"></a>
                                         <code class="literal">DB_USE_ENVIRON</code>
                                </p>
                <p>
                                        The Berkeley DB process' environment may be permitted to specify information to
                                        be used when naming files; see 
                                        <a href="../../programmer_reference/env_naming.html" class="olink">Berkeley DB File Naming</a>. 
                                        Because permitting users to specify which files are used can create security 
                                        problems, environment information will be used in file naming for all users 
                                        only if the <code class="literal">DB_USE_ENVIRON</code> flag is set.
                                </p>
              </li>
              <li>
                <p><a id="envopen_DB_USE_ENVIRON_ROOT"></a>
                                         <code class="literal">DB_USE_ENVIRON_ROOT</code>
                                </p>
                <p>
                                        The Berkeley DB process' environment may be permitted to specify information to
                                        be used when naming files; see 
                                        <a href="../../programmer_reference/env_naming.html" class="olink">Berkeley DB File Naming</a>. 
                                        Because permitting users to specify which files are used can create security 
                                        problems, if the <code class="literal">DB_USE_ENVIRON_ROOT</code> flag is set, environment 
                                        information will be used in file naming only for users with appropriate
                                        permissions (for example, users with a user-ID of 0 on <code class="literal">UNIX</code>
                                        systems).
                                </p>
              </li>
            </ul>
          </div>
          <p>
                        Finally, there are a few additional unrelated flags:
                </p>
          <div class="itemizedlist">
            <ul type="disc">
              <li>
                <p><a id="envopen_DB_CREATE"></a>
                                         <code class="literal">DB_CREATE</code>
                                </p>
                <p>
                                        Cause Berkeley DB subsystems to create any underlying files, as necessary.
                                </p>
              </li>
              <li>
                <p><a id="envopen_DB_LOCKDOWN"></a>
                                         <code class="literal">DB_LOCKDOWN</code>
                                </p>
                <p>
                                        Lock shared Berkeley DB environment files and memory-mapped databases into
                                        memory.
                                </p>
              </li>
              <li>
                <p><a id="envopen_DB_FAILCHK"></a>
					 <code class="literal">DB_FAILCHK</code>
				</p>
                <p>
					Internally call the <a class="xref" href="envfailchk.html" title="DbEnv::failchk()">DbEnv::failchk()</a>  
					method as part of opening the environment.  When  <code class="literal">DB_FAILCHK</code> is
					specified, a check is made to ensure all  <code class="methodname">DbEnv::failchk()</code>
					prerequisites are meet.
				</p>
                <p>
					If the <code class="literal">DB_FAILCHK</code> flag is used in conjunction with the
					<code class="literal">DB_REGISTER</code> flag, then a check will be made to see if 
					the environment needs recovery.  If recovery is needed, a call
					will be made to the <code class="methodname">DbEnv::failchk()</code> method
					to release any database reads locks held by the thread of control that 
					exited and, if needed, to abort the unresolved transaction.  If  
					<code class="methodname">DbEnv::failchk()</code> determines environment recovery 
					is still 
					required, the recovery actions for <code class="literal">DB_REGISTER</code> will be 
					followed.    
				</p>
                <p>
					If the <code class="literal">DB_FAILCHK</code> flag is not used in conjunction with the
					<code class="literal">DB_REGISTER</code> flag, then make an internal call to 
					<code class="methodname">DbEnv::failchk()</code> as the last step of opening the environment. 
					If <code class="methodname">DbEnv::failchk()</code> determines database environment recovery is 
					required, <a href="../../programmer_reference/program_errorret.html#program_errorret.DB_RUNRECOVERY" class="olink">DB_RUNRECOVERY</a>
					will be returned.

				</p>
              </li>
              <li>
                <p><a id="envopen_DB_PRIVATE"></a>
                                         <code class="literal">DB_PRIVATE</code>
                                </p>
                <p>
                                        Allocate region memory from the heap instead of from memory backed by the
                                        filesystem or system shared memory.
                                </p>
                <p>
                                        This flag implies the environment will only be accessed by a single process
                                        (although that process may be multithreaded). This flag has two effects on the
                                        Berkeley DB environment. First, all underlying data structures are allocated
                                        from per-process memory instead of from shared memory that is accessible to more
                                        than a single process. Second, mutexes are only configured to work between
                                        threads.
                                </p>
                <p>
                                        This flag should not be specified if more than a single process is accessing the
                                        environment because it is likely to cause database corruption and unpredictable
                                        behavior. For example, if both a server application and Berkeley DB utilities
                                        (for example, 
                                        <a class="link" href="db_archive.html" title="db_archive">db_archive</a>, 
                                        <a class="link" href="db_checkpoint.html" title="db_checkpoint">db_checkpoint</a> or 
                                        <a class="link" href="db_stat.html" title="db_stat">db_stat</a>) are expected to access the
                                        environment, the <code class="literal">DB_PRIVATE</code> flag should not be specified.
                                </p>
                <p>
                                        See <a href="../../programmer_reference/env_region.html" class="olink">Shared Memory Regions</a> for more 
                                        information.
                                </p>
                <p>
                                        You can also specify this flag in the 
										<a href="../../programmer_reference/env_db_config.html#env_db_config.DB_CONFIG" class="olink">DB_CONFIG</a>
										configuration file. The syntax is a single line with the string "set_open_flags",
										one or more whitespace characters, the string "DB_PRIVATE", 
										optionally one or more whitespace characters and the string "on" or "off". If the optional
										string is omitted, the default is "on"; for example, "set_open_flags DB_PRIVATE" or "set_open_flags DB_PRIVATE on". 
										Because the DB_CONFIG file is read when the database environment is
										opened, it will silently overrule configuration done before that time.
                                </p>
              </li>
              <li>
                <p><a id="envopen_DB_REGISTER"></a>
                                        <code class="literal">DB_REGISTER</code>
                                </p>
                <p>
                                        Check to see if recovery needs to be performed before opening the database
                                        environment. (For this check to be accurate, all processes using the environment
                                        must specify <code class="literal">DB_REGISTER</code> when opening the environment.) If 
                                        recovery needs to be performed for any reason (including the initial use of the 
                                        <code class="literal">DB_REGISTER</code> flag), and <code class="literal">DB_RECOVER</code> is also 
                                        specified, recovery will be performed and the open will
                                        proceed normally. If recovery needs to be performed and 
                                        <code class="literal">DB_RECOVER</code> is not specified, 
                                        <a href="../../programmer_reference/program_errorret.html#program_errorret.DB_RUNRECOVERY" class="olink">DB_RUNRECOVERY</a> 
                                        will be returned.  If recovery does not need to be performed, the 
                                        <code class="literal">DB_RECOVER</code> flag will be ignored. See 
                                        <a href="../../programmer_reference/transapp_app.html" class="olink">Architecting Transactional Data Store applications</a> for more information.
                                </p>
              </li>
              <li>
                <p><a id="envopen_DB_SYSTEM_MEM"></a>
                                         <code class="literal">DB_SYSTEM_MEM</code>
                                </p>
                <p>
                                        Allocate region memory from system shared memory instead of from heap memory or
                                        memory backed by the filesystem. 
                                </p>
                <p>
                                        See <a href="../../programmer_reference/env_region.html" class="olink">Shared Memory Regions</a> for more 
                                        information.
                                </p>
              </li>
              <li>
                <p><a id="envopen_DB_THREAD"></a>
                                         <code class="literal">DB_THREAD</code>
                                </p>
                <p>
                                        Cause the 
                                        <a class="link" href="env.html" title="Chapter 5.  The DbEnv Handle">DbEnv</a> 
                                        handle returned by <code class="methodname">DbEnv::open()</code> to be <span class="emphasis"><em>free-threaded;</em></span> that is,
                                        concurrently usable by multiple threads in the address space. The 
                                        <code class="literal">DB_THREAD </code> flag
                                        should be specified if the 
                                        <a class="link" href="env.html" title="Chapter 5.  The DbEnv Handle">DbEnv</a> 
                                        handle will be concurrently used by more than
                                        one thread in the process, or if any 
                                        <a class="link" href="db.html" title="Chapter 2.  The Db Handle">Db</a> 
                                        handles opened in the scope of the
                                        <a class="link" href="env.html" title="Chapter 5.  The DbEnv Handle">DbEnv</a> 
                                        handle will be concurrently used by more than one thread in the process.
                                </p>
                <p>
                                        This flag is required when using the Replication Manager.
                                </p>
                <p>
                                        You can also specify this flag in the 
										<a href="../../programmer_reference/env_db_config.html#env_db_config.DB_CONFIG" class="olink">DB_CONFIG</a>
										configuration file. The syntax is a single line with the string "set_open_flags",
										one or more whitespace characters, the string "DB_THREAD", 
										optionally one or more whitespace characters and the string "on" or "off". If the optional
										string is omitted, the default is "on"; for example, "set_open_flags DB_THREAD" or "set_open_flags DB_THREAD on". 
										Because the DB_CONFIG file is read when the database environment is
										opened, it will silently overrule configuration done before that time.
                                </p>
              </li>
            </ul>
          </div>
        </div>
        <div class="sect3" lang="en" xml:lang="en">
          <div class="titlepage">
            <div>
              <div>
                <h4 class="title"><a id="idp51816424"></a>mode</h4>
              </div>
            </div>
          </div>
          <p>
                          On Windows systems, the mode parameter is ignored.                    
                    </p>
          <p>
                          On UNIX systems or in IEEE/ANSI Std 1003.1 (POSIX) environments, files
                          created by Berkeley DB are created with mode <span class="bold"><strong>mode</strong></span> (as described in <span class="bold"><strong>chmod</strong></span>(2)) and modified by the process' umask
                          value at the time of creation (see <span class="bold"><strong>umask</strong></span>(2)).  Created files are owned by the
                          process owner; the group ownership of created files is based on the
                          system and directory defaults, and is not further specified by
                          Berkeley DB.  System shared memory segments created by Berkeley DB are
                          created with mode <span class="bold"><strong>mode</strong></span>, unmodified by
                          the process' umask value.  If <span class="bold"><strong>mode</strong></span> is
                          0, Berkeley DB will use a default mode of readable and writable by
                          both owner and group.
                     </p>
        </div>
      </div>
      <div class="sect2" lang="en" xml:lang="en">
        <div class="titlepage">
          <div>
            <div>
              <h3 class="title"><a id="idp51830904"></a>Errors</h3>
            </div>
          </div>
        </div>
        <p>
                         The <code class="methodname">DbEnv::open()</code> <span>
            
            <span>
                method may fail and throw a <a class="link" href="dbexception.html" title="Chapter 6. The DbException Class">DbException</a> 
                exception, encapsulating one of the following non-zero errors, or return one
                of the following non-zero errors:
            </span>
        </span>
                    </p>
        <div class="sect3" lang="en" xml:lang="en">
          <div class="titlepage">
            <div>
              <div>
                <h4 class="title"><a id="idp51871560"></a>DB_RUNRECOVERY</h4>
              </div>
            </div>
          </div>
          <p>
                             Either the <code class="literal">DB_REGISTER</code> flag was specified, a failure occurred, and
                             no recovery flag was specified, or the <code class="literal">DB_FAILCHK</code> flag was specified
			     and recovery was deemed necessary.
                        </p>
        </div>
        <div class="sect3" lang="en" xml:lang="en">
          <div class="titlepage">
            <div>
              <div>
                <h4 class="title"><a id="idp51831704"></a>DB_VERSION_MISMATCH</h4>
              </div>
            </div>
          </div>
          <p>
                          The version of the Berkeley DB library doesn't match the version that
                          created the database environment.
                        </p>
        </div>
        <div class="sect3" lang="en" xml:lang="en">
          <div class="titlepage">
            <div>
              <div>
                <h4 class="title"><a id="idp51891432"></a>EAGAIN</h4>
              </div>
            </div>
          </div>
          <p>
                          The shared memory region was locked and (repeatedly) unavailable.
                        </p>
        </div>
        <div class="sect3" lang="en" xml:lang="en">
          <div class="titlepage">
            <div>
              <div>
                <h4 class="title"><a id="idp51905504"></a>EINVAL</h4>
              </div>
            </div>
          </div>
          <p>
                             If the <code class="literal">DB_THREAD</code> flag was specified and fast mutexes are not available
                             for this architecture; The <code class="literal">DB_HOME</code> or <code class="literal">TMPDIR</code> 
                             environment variables were set, but empty; An incorrectly formatted <span class="bold"><strong>NAME VALUE</strong></span> entry or line was found; or if an
                          invalid flag value or parameter was specified.
                        </p>
        </div>
        <div class="sect3" lang="en" xml:lang="en">
          <div class="titlepage">
            <div>
              <div>
                <h4 class="title"><a id="idp51825048"></a>ENOSPC</h4>
              </div>
            </div>
          </div>
          <p>
                          HP-UX only: Due to the constraints of the PA-RISC memory architecture,
                          HP-UX does not allow a process to map a file into its address space
                          multiple times. For this reason, each Berkeley DB environment may be
                          opened only once by a process on HP-UX; that is, calls to
                          <code class="methodname">DbEnv::open()</code> will fail if the specified Berkeley DB environment has
                          been opened and not subsequently closed.
                        </p>
        </div>
        <div class="sect3" lang="en" xml:lang="en">
          <div class="titlepage">
            <div>
              <div>
                <h4 class="title"><a id="idp51857464"></a>ENOENT</h4>
              </div>
            </div>
          </div>
          <p>
                The file or directory does not exist.
            </p>
        </div>
      </div>
      <div class="sect2" lang="en" xml:lang="en">
        <div class="titlepage">
          <div>
            <div>
              <h3 class="title"><a id="idp51869400"></a>Class</h3>
            </div>
          </div>
        </div>
        <p>
                <a class="link" href="env.html" title="Chapter 5.  The DbEnv Handle">DbEnv</a>  
            </p>
      </div>
      <div class="sect2" lang="en" xml:lang="en">
        <div class="titlepage">
          <div>
            <div>
              <h3 class="title"><a id="idp51877080"></a>See Also</h3>
            </div>
          </div>
        </div>
        <p>
                     <a class="xref" href="env.html#envlist" title="Database Environments and Related Methods">Database Environments and Related Methods</a> 
                </p>
      </div>
    </div>
    <div class="navfooter">
      <hr />
      <table width="100%" summary="Navigation footer">
        <tr>
          <td width="40%" align="left"><a accesskey="p" href="envlsn_reset.html">Prev</a> </td>
          <td width="20%" align="center">
            <a accesskey="u" href="env.html">Up</a>
          </td>
          <td width="40%" align="right"> <a accesskey="n" href="envremove.html">Next</a></td>
        </tr>
        <tr>
          <td width="40%" align="left" valign="top">DbEnv::lsn_reset() </td>
          <td width="20%" align="center">
            <a accesskey="h" href="index.html">Home</a>
          </td>
          <td width="40%" align="right" valign="top"> DbEnv::remove()</td>
        </tr>
      </table>
    </div>
  </body>
</html>