~ubuntu-branches/ubuntu/edgy/rpm/edgy

« back to all changes in this revision

Viewing changes to db/docs/ref/program/scope.html

  • Committer: Bazaar Package Importer
  • Author(s): Joey Hess
  • Date: 2002-01-22 20:56:57 UTC
  • Revision ID: james.westby@ubuntu.com-20020122205657-l74j50mr9z8ofcl5
Tags: upstream-4.0.3
ImportĀ upstreamĀ versionĀ 4.0.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<!--$Id: scope.so,v 10.7 2001/05/05 01:49:27 bostic Exp $-->
 
2
<!--Copyright 1997-2001 by Sleepycat Software, Inc.-->
 
3
<!--All rights reserved.-->
 
4
<html>
 
5
<head>
 
6
<title>Berkeley DB Reference Guide: Berkeley DB handles</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++">
 
9
</head>
 
10
<body bgcolor=white>
 
11
<a name="2"><!--meow--></a><a name="3"><!--meow--></a>
 
12
<table width="100%"><tr valign=top>
 
13
<td><h3><dl><dt>Berkeley DB Reference Guide:<dd>Programmer Notes</dl></h3></td>
 
14
<td align=right><a href="../../ref/program/mt.html"><img src="../../images/prev.gif" alt="Prev"></a><a href="../../reftoc.html"><img src="../../images/ref.gif" alt="Ref"></a><a href="../../ref/program/namespace.html"><img src="../../images/next.gif" alt="Next"></a>
 
15
</td></tr></table>
 
16
<p>
 
17
<h1 align=center>Berkeley DB handles</h1>
 
18
<p>The Berkeley DB library has a number of object handles.  The following table
 
19
lists those handles, their scope, and whether they are free-threaded
 
20
(that is, whether multiple threads within a process can share them).
 
21
<p><dl compact>
 
22
<p><dt>DB_ENV<dd>The DB_ENV handle, created by the <a href="../../api_c/env_create.html">db_env_create</a> function, refers
 
23
to a Berkeley DB database environment -- a collection of Berkeley DB subsystems,
 
24
log files and databases.  DB_ENV handles are free-threaded if
 
25
the <a href="../../api_c/env_open.html#DB_THREAD">DB_THREAD</a> flag is specified to the <a href="../../api_c/env_open.html">DB_ENV-&gt;open</a> function when
 
26
the environment is opened.  The handle should not be closed while any
 
27
other handle remains open that is using it as a reference (for example,
 
28
DB or DB_TXN).  Once either the <a href="../../api_c/env_close.html">DB_ENV-&gt;close</a> or
 
29
<a href="../../api_c/env_remove.html">DB_ENV-&gt;remove</a> functions are called, the handle may not be accessed again,
 
30
regardless of the function's return.
 
31
<p><dt>DB_TXN<dd>The DB_TXN handle, created by the <a href="../../api_c/txn_begin.html">txn_begin</a> function, refers to
 
32
a single transaction.  The handle is not free-threaded; and transactions
 
33
may not span threads, nor may transactions be used by more than a single
 
34
thread.  Once the <a href="../../api_c/txn_abort.html">txn_abort</a> or <a href="../../api_c/txn_commit.html">txn_commit</a> functions are called,
 
35
the handle may not be accessed again, regardless of the function's
 
36
return.  In addition, parent transactions may not issue any Berkeley DB
 
37
operations while they have active child transactions (child transactions
 
38
that have not yet been committed or aborted) except for
 
39
<a href="../../api_c/txn_begin.html">txn_begin</a>, <a href="../../api_c/txn_abort.html">txn_abort</a> and <a href="../../api_c/txn_commit.html">txn_commit</a>.
 
40
<p><dt>DB_MPOOLFILE<dd>The DB_MPOOLFILE handle refers to an open file in the shared
 
41
memory buffer pool of the database environment.  The handle is not
 
42
free-threaded.  Once the <a href="../../api_c/memp_fclose.html">memp_fclose</a> function is called, the handle may
 
43
not be accessed again, regardless of the function's return.
 
44
<p><dt>DB<dd>The DB handle, created by the <a href="../../api_c/db_create.html">db_create</a> function, refers to a
 
45
single Berkeley DB database, which may or may not be part of a database
 
46
environment.  DB handles are free-threaded if the
 
47
<a href="../../api_c/env_open.html#DB_THREAD">DB_THREAD</a> flag is specified to the <a href="../../api_c/db_open.html">DB-&gt;open</a> function when the
 
48
database is opened or if the database environment in which the database
 
49
is opened is free-threaded.  The handle should not be closed while any
 
50
other handle that refers to the database is in use; for example,
 
51
database handles must not be closed while cursor handles into the
 
52
database remain open, or transactions that include operations on the
 
53
database have not yet been committed or aborted.  Once the
 
54
<a href="../../api_c/db_close.html">DB-&gt;close</a>, <a href="../../api_c/db_remove.html">DB-&gt;remove</a>, or <a href="../../api_c/db_rename.html">DB-&gt;rename</a> functions are
 
55
called, the handle may not be accessed again, regardless of the
 
56
function's return.
 
57
<p><dt>DBC<dd>The DBC handle refers to a cursor into a Berkeley DB database.  The
 
58
handle is not free-threaded, and cursors may not span threads; nor may
 
59
cursors be used by more than a single thread.  If the cursor is to be
 
60
used to perform operations on behalf of a transaction, the cursor must
 
61
be opened and closed within the context of that single transaction.
 
62
Once <a href="../../api_c/dbc_close.html">DBcursor-&gt;c_close</a> has been called, the handle may not be accessed
 
63
again, regardless of the function's return.
 
64
</dl>
 
65
<table width="100%"><tr><td><br></td><td align=right><a href="../../ref/program/mt.html"><img src="../../images/prev.gif" alt="Prev"></a><a href="../../reftoc.html"><img src="../../images/ref.gif" alt="Ref"></a><a href="../../ref/program/namespace.html"><img src="../../images/next.gif" alt="Next"></a>
 
66
</td></tr></table>
 
67
<p><font size=1><a href="http://www.sleepycat.com">Copyright Sleepycat Software</a></font>
 
68
</body>
 
69
</html>