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
|
<!--$Id: seq_open.so,v 1.7 2004/09/28 15:04:22 bostic Exp $-->
<!--Copyright 1997-2004 by Sleepycat Software, Inc.-->
<!--All rights reserved.-->
<!--See the file LICENSE for redistribution information.-->
<html>
<head>
<title>Berkeley DB: DB_SEQUENCE->open</title>
<meta name="description" content="Berkeley DB: An embedded database programmatic toolkit.">
<meta name="keywords" content="embedded,database,programmatic,toolkit,btree,hash,hashing,transaction,transactions,locking,logging,access method,access methods,Java,C,C++">
</head>
<body bgcolor=white>
<table width="100%"><tr valign=top>
<td>
<h3>DB_SEQUENCE->open</h3>
</td>
<td align=right>
<a href="../api_c/api_core.html"><img src="../images/api.gif" alt="API"></a>
<a href="../ref/toc.html"><img src="../images/ref.gif" alt="Ref"></a></td>
</tr></table>
<hr size=1 noshade>
<tt>
<h3><pre>
#include <db.h>
<p>
int
DB_SEQUENCE->open(DB_SEQUENCE *seq, DB_TXN *txnid, DBT *key, u_int32_t flags);
<p>
int
DB_SEQUENCE->get_dbp(DB_SEQUENCE *seq, DB **dbp);
<p>
int
DB_SEQUENCE->get_key(DB_SEQUENCE *seq, DBT *key);
<p>
int
</pre></h3>
<hr size=1 noshade>
<h3>Description: DB_SEQUENCE->open</h3>
<p>The DB_SEQUENCE->open method opens the sequence represented by the <b>key</b>.
The key must be compatible with the underlying database specified in the
corresponding call to <a href="../api_c/seq_class.html">db_sequence_create</a>.</p>
<h3>Parameters</h3>
<dl compact>
<dt><b>key</b><dd>The <b>key</b> specifies which record in the database stores
the persistent sequence data.
<dt><b>flags</b><dd>The <b>flags</b> parameter must be set to 0 or by bitwise inclusively <b>OR</b>'ing together one
or more of the following values:
<dl compact>
<dt><a name="DB_AUTO_COMMIT">DB_AUTO_COMMIT</a><dd>Enclose the DB_SEQUENCE->open call within a transaction. If the call
succeeds, the open operation will be recoverable. If the
<a href="../api_c/env_open.html#DB_CREATE">DB_CREATE</a> flag is specified and the call fails, no sequence will
have been created.
<dt><a name="DB_CREATE">DB_CREATE</a><dd>Create the sequence. If the sequence does not already exist and the
DB_CREATE flag is not specified, the DB_SEQUENCE->open will fail.
<dt><a name="DB_EXCL">DB_EXCL</a><dd>Return an error if the sequence already exists. The <a href="../api_c/db_open.html#DB_EXCL">DB_EXCL</a>
flag is only meaningful when specified with the <a href="../api_c/env_open.html#DB_CREATE">DB_CREATE</a>
flag.
<dt><a name="DB_THREAD">DB_THREAD</a><dd>Cause the <a href="../api_c/seq_class.html">DB_SEQUENCE</a> handle returned by DB_SEQUENCE->open to be
<i>free-threaded</i>; that is, usable by multiple threads within a
single address space.
</dl>
<dt><b>txnid</b><dd>If the operation is to be transaction-protected,
(other than by specifying the DB_AUTO_COMMIT flag),
the <b>txnid</b> parameter is a transaction handle returned from
<a href="../api_c/txn_begin.html">DB_ENV->txn_begin</a>; otherwise, NULL. Note that transactionally protected operations on a <a href="../api_c/seq_class.html">DB_SEQUENCE</a>
handle require the <a href="../api_c/seq_class.html">DB_SEQUENCE</a> handle itself be transactionally
protected during its open if the open creates the sequence.
</dl>
<hr size=1 noshade>
<h3>Description: DB_SEQUENCE->get_dbp</h3>
<p>The DB_SEQUENCE->get_dbp method returns the database handle.</p>
<h3>Parameters</h3>
<dl compact>
<dt><b>dbp</b><dd>The <b>dbp</b> parameter references memory into which
a pointer to the database handle is copied.
</dl>
<p>The DB_SEQUENCE->get_dbp method may be called at any time during the life of the
application.</p>
<p>The DB_SEQUENCE->get_dbp method
returns a non-zero error value on failure
and 0 on success.
</p>
<hr size=1 noshade>
<h3>Description: DB_SEQUENCE->get_key</h3>
<p>The DB_SEQUENCE->get_key method returns the key for the sequence.</p>
<h3>Parameters</h3>
<dl compact>
<dt><b>key</b><dd>The <b>key</b> parameter references memory into which
a pointer to the key data is copied.
</dl>
<p>The DB_SEQUENCE->get_key method may be called at any time during the life of the
application.</p>
<p>The DB_SEQUENCE->get_key method
returns a non-zero error value on failure
and 0 on success.
</p>
<hr size=1 noshade>
<h3>Class</h3>
<a href="../api_c/seq_class.html">DB_SEQUENCE</a>
<h3>See Also</h3>
<a href="../api_c/seq_list.html">Sequences and Related Methods</a>
</tt>
<table width="100%"><tr><td><br></td><td align=right>
<a href="../api_c/api_core.html"><img src="../images/api.gif" alt="API"></a><a href="../ref/toc.html"><img src="../images/ref.gif" alt="Ref"></a>
</td></tr></table>
<p><font size=1><a href="../sleepycat/legal.html">Copyright (c) 1996-2004</a> <a href="http://www.sleepycat.com">Sleepycat Software, Inc.</a> - All rights reserved.</font>
</body>
</html>
|