~ubuntu-branches/ubuntu/maverick/evolution-data-server/maverick-proposed

« back to all changes in this revision

Viewing changes to libdb/docs/api_cxx/db_class.html

  • Committer: Bazaar Package Importer
  • Author(s): Didier Roche
  • Date: 2010-05-17 17:02:06 UTC
  • mfrom: (1.1.79 upstream) (1.6.12 experimental)
  • Revision ID: james.westby@ubuntu.com-20100517170206-4ufr52vwrhh26yh0
Tags: 2.30.1-1ubuntu1
* Merge from debian experimental. Remaining change:
  (LP: #42199, #229669, #173703, #360344, #508494)
  + debian/control:
    - add Vcs-Bzr tag
    - don't use libgnome
    - Use Breaks instead of Conflicts against evolution 2.25 and earlier.
  + debian/evolution-data-server.install,
    debian/patches/45_libcamel_providers_version.patch:
    - use the upstream versioning, not a Debian-specific one 
  + debian/libedata-book1.2-dev.install, debian/libebackend-1.2-dev.install,
    debian/libcamel1.2-dev.install, debian/libedataserverui1.2-dev.install:
    - install html documentation
  + debian/rules:
    - don't build documentation it's shipped with the tarball

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<!--$Id$-->
2
 
<!--Copyright 1997-2002 by Sleepycat Software, Inc.-->
3
 
<!--All rights reserved.-->
4
 
<!--See the file LICENSE for redistribution information.-->
5
 
<html>
6
 
<head>
7
 
<title>Berkeley DB: Db</title>
8
 
<meta name="description" content="Berkeley DB: An embedded database programmatic toolkit.">
9
 
<meta name="keywords" content="embedded,database,programmatic,toolkit,b+tree,btree,hash,hashing,transaction,transactions,locking,logging,access method,access methods,java,C,C++">
10
 
</head>
11
 
<body bgcolor=white>
12
 
<a name="2"><!--meow--></a>
13
 
<table width="100%"><tr valign=top>
14
 
<td>
15
 
<h1>Db</h1>
16
 
</td>
17
 
<td align=right>
18
 
<a href="../api_cxx/c_index.html"><img src="../images/api.gif" alt="API"></a><a href="../reftoc.html"><img src="../images/ref.gif" alt="Ref"></a>
19
 
</td></tr></table>
20
 
<hr size=1 noshade>
21
 
<tt>
22
 
<h3><pre>
23
 
#include &lt;db_cxx.h&gt;
24
 
<p>
25
 
class Db {
26
 
public:
27
 
        Db(DbEnv *dbenv, u_int32_t flags);
28
 
        ~Db();
29
 
<p>
30
 
        DB *Db::get_DB();
31
 
        const DB *Db::get_const_DB() const;
32
 
        static Db *Db::get_Db(DB *db);
33
 
        static const Db *Db::get_const_Db(const DB *db);
34
 
        ...
35
 
};
36
 
</pre></h3>
37
 
<h1>Description</h1>
38
 
<p>The Db handle is the handle for a Berkeley DB database, which may or
39
 
may not be part of a database environment.  Db handles are
40
 
free-threaded if the <a href="../api_cxx/env_open.html#DB_THREAD">DB_THREAD</a> flag is specified to the
41
 
<a href="../api_cxx/db_open.html">Db::open</a> method when the database is opened or if the database
42
 
environment in which the database is opened is free-threaded.  The
43
 
handle should not be closed while any other handle that refers to the
44
 
database is in use; for example, database handles must not be closed
45
 
while cursor handles into the database remain open, or transactions that
46
 
include operations on the database have not yet been committed or
47
 
aborted.  Once the <a href="../api_cxx/db_close.html">Db::close</a>, <a href="../api_cxx/db_remove.html">Db::remove</a>, or
48
 
<a href="../api_cxx/db_rename.html">Db::rename</a> methods are called, the handle may not be accessed again,
49
 
regardless of the method's return.
50
 
<p>The constructor creates a Db object that is the handle for a
51
 
Berkeley DB database.  The constructor allocates memory internally; calling
52
 
the <a href="../api_cxx/db_close.html">Db::close</a>, <a href="../api_cxx/db_remove.html">Db::remove</a> or <a href="../api_cxx/db_rename.html">Db::rename</a> methods will
53
 
free that memory.
54
 
<p>If no <b>dbenv</b> value is specified, the database is standalone; that
55
 
is, it is not part of any Berkeley DB environment.
56
 
<p>If a <b>dbenv</b> value is specified, the database is created within
57
 
the specified Berkeley DB environment. The database access methods
58
 
automatically make calls to the other subsystems in Berkeley DB based on the
59
 
enclosing environment. For example, if the environment has been
60
 
configured to use locking, the access methods will automatically acquire
61
 
the correct locks when reading and writing pages of the database.
62
 
<p>The <b>flags</b> value must be set to 0 or by bitwise inclusively <b>OR</b>'ing together one or
63
 
more of the following values:
64
 
<p><dl compact>
65
 
<p><dt><a name="DB_CXX_NO_EXCEPTIONS">DB_CXX_NO_EXCEPTIONS</a><dd>The Berkeley DB C++ API supports two different error behaviors.  By default,
66
 
whenever an error occurs, an exception is thrown that encapsulates the
67
 
error information.  This generally allows for cleaner logic for
68
 
transaction processing because a try block can surround a single
69
 
transaction.  However, if DB_CXX_NO_EXCEPTIONS is specified,
70
 
exceptions are not thrown; instead, each individual function returns an
71
 
error code.
72
 
<p>If <b>dbenv</b> is not null, this flag is ignored, and the error behavior
73
 
of the specified environment is used instead.
74
 
<p><dt><a name="DB_XA_CREATE">DB_XA_CREATE</a><dd>Instead of creating a standalone database, create a database intended to
75
 
be accessed via applications running under a X/Open conformant Transaction
76
 
Manager.  The database will be opened in the environment specified by the
77
 
OPENINFO parameter of the GROUPS section of the ubbconfig file.  See the
78
 
<a href="../ref/xa/intro.html">XA Resource Manager</a> chapter in the
79
 
Reference Guide for more information.
80
 
</dl>
81
 
<p>Each Db object has an associated DB struct, which is
82
 
used by the underlying implementation of Berkeley DB and its C-language API.
83
 
The Db::get_DB method returns a pointer to this struct.  Given a const
84
 
Db object, Db::get_const_DB returns a const pointer to the
85
 
same struct.
86
 
<p>Given a DB struct, the Db::get_Db method returns the
87
 
corresponding Db object, if there is one.  If the DB
88
 
object was not associated with a Db (that is, it was not
89
 
returned from a call to Db::get_DB), then the result of Db::get_Db is
90
 
undefined.  Given a const DB struct, Db::get_const_Db returns
91
 
the associated const Db object, if there is one.
92
 
<p>These methods may be useful for Berkeley DB applications including  both C
93
 
and C++ language software.  It should not be necessary to use these
94
 
calls in a purely C++ application.
95
 
<h1>Class</h1>
96
 
Db
97
 
<h1>See Also</h1>
98
 
<a href="../api_cxx/db_list.html">Databases and Related Methods</a>
99
 
</tt>
100
 
<table width="100%"><tr><td><br></td><td align=right>
101
 
<a href="../api_cxx/c_index.html"><img src="../images/api.gif" alt="API"></a><a href="../reftoc.html"><img src="../images/ref.gif" alt="Ref"></a>
102
 
</td></tr></table>
103
 
<p><font size=1><a href="http://www.sleepycat.com">Copyright Sleepycat Software</a></font>
104
 
</body>
105
 
</html>