Debian Codegraph @

docs/api_reference/CXX/dbcclose.html

raw symbols SCIP
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>Dbc::close()</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="dbc.html" title="Chapter 3.  The Dbc Handle" />
11 <link rel="prev" href="dbcursor.html" title="Db::cursor()" />
12 <link rel="next" href="dbccmp.html" title="Dbc::cmp()" />
13 </head>
14 <body>
15 <div xmlns="" class="navheader">
16 <div class="libver">
17 <p>Library Version 11.2.5.3</p>
18 </div>
19 <table width="100%" summary="Navigation header">
20 <tr>
21 <th colspan="3" align="center">Dbc::close()</th>
22 </tr>
23 <tr>
24 <td width="20%" align="left"><a accesskey="p" href="dbcursor.html">Prev</a> </td>
25 <th width="60%" align="center">Chapter 3. 
26 The Dbc Handle
27 </th>
28 <td width="20%" align="right"> <a accesskey="n" href="dbccmp.html">Next</a></td>
29 </tr>
30 </table>
31 <hr />
32 </div>
33 <div class="sect1" lang="en" xml:lang="en">
34 <div class="titlepage">
35 <div>
36 <div>
37 <h2 class="title" style="clear: both"><a id="dbcclose"></a>Dbc::close()</h2>
38 </div>
39 </div>
40 </div>
41 <pre class="programlisting">#include &lt;db_cxx.h&gt;
42
43 int
44 Dbc::close(void);</pre>
45 <p>
46 The <code class="methodname">Dbc::close()</code> method discards the cursor.
47 </p>
48 <p>
49 It is possible for the <code class="methodname">Dbc::close()</code> method to return <a href="../../programmer_reference/program_errorret.html#program_errorret.DB_LOCK_DEADLOCK" class="olink">DB_LOCK_DEADLOCK</a>,
50 signaling that any enclosing transaction should be aborted. If the
51 application is already intending to abort the transaction, this error
52 should be ignored, and the application should proceed.
53 </p>
54 <p>
55 After the <code class="methodname">Dbc::close()</code> method has been called, regardless of its return value,
56 you can not use the cursor handle again.
57 </p>
58 <p>
59 It is not required to close the cursor explicitly before closing the database handle or the transaction handle that owns this cursor
60 because, closing a database handle or a transaction handle closes those open cursors.
61
62 </p>
63 <p>
64 However, it is recommended that you always close all cursor handles immediately after
65 their use to promote concurrency and to release resources such as page locks.
66 </p>
67 <p>
68 The <code class="methodname">Dbc::close()</code> <span>
69
70 <span>
71 method either returns a non-zero error value or throws an
72 exception that encapsulates a non-zero error value on
73 failure, and returns 0 on success.
74 </span>
75 </span>
76 </p>
77 <div class="sect2" lang="en" xml:lang="en">
78 <div class="titlepage">
79 <div>
80 <div>
81 <h3 class="title"><a id="idp6089344"></a>Errors</h3>
82 </div>
83 </div>
84 </div>
85 <p>
86 The <code class="methodname">Dbc::close()</code> <span>
87
88 <span>
89 method may fail and throw a <a class="link" href="dbexception.html" title="Chapter 6. The DbException Class">DbException</a>
90 exception, encapsulating one of the following non-zero errors, or return one
91 of the following non-zero errors:
92 </span>
93 </span>
94 </p>
95 <div class="sect3" lang="en" xml:lang="en">
96 <div class="titlepage">
97 <div>
98 <div>
99 <h4 class="title"><a id="idp6118880"></a><span>DbDeadlockException or </span>DB_LOCK_DEADLOCK</h4>
100 </div>
101 </div>
102 </div>
103 <p>
104 A transactional database environment operation was selected to resolve
105 a deadlock.
106 </p>
107 <p>
108 <a class="xref" href="dbdeadlock.html" title="DbDeadlockException">DbDeadlockException</a> is thrown if
109 your Berkeley DB API is configured to throw exceptions.
110 Otherwise, <code class="literal">DB_LOCK_DEADLOCK</code> is returned.
111 </p>
112 </div>
113 <div class="sect3" lang="en" xml:lang="en">
114 <div class="titlepage">
115 <div>
116 <div>
117 <h4 class="title"><a id="idp6092240"></a><span>DbLockNotGrantedException or </span>DB_LOCK_NOTGRANTED</h4>
118 </div>
119 </div>
120 </div>
121 <p>
122 A Berkeley DB Concurrent Data Store database environment configured
123 for lock timeouts was unable to grant a lock in the allowed time.
124 </p>
125 <p>
126 You attempted to open a database handle that is configured
127 for no waiting exclusive locking, but the exclusive lock could not be
128 immediately obtained. See
129 <a class="xref" href="dbset_lk_exclusive.html" title="Db::set_lk_exclusive()">Db::set_lk_exclusive()</a>
130 for more information.
131 </p>
132 <p>
133 <a class="xref" href="dblocknotgranted.html" title="DbLockNotGrantedException">DbLockNotGrantedException</a> is thrown if
134 your Berkeley DB API is configured to throw exceptions.
135 Otherwise, <code class="literal">DB_LOCK_NOTGRANTED</code> is returned.
136 </p>
137 </div>
138 <div class="sect3" lang="en" xml:lang="en">
139 <div class="titlepage">
140 <div>
141 <div>
142 <h4 class="title"><a id="idp6108448"></a>EINVAL</h4>
143 </div>
144 </div>
145 </div>
146 <p>
147 If the cursor is already closed; or if an invalid flag value or parameter was specified.
148 </p>
149 </div>
150 </div>
151 <div class="sect2" lang="en" xml:lang="en">
152 <div class="titlepage">
153 <div>
154 <div>
155 <h3 class="title"><a id="idp6104048"></a>Class</h3>
156 </div>
157 </div>
158 </div>
159 <p>
160 <a class="link" href="dbc.html" title="Chapter 3.  The Dbc Handle">Dbc</a>
161 </p>
162 </div>
163 <div class="sect2" lang="en" xml:lang="en">
164 <div class="titlepage">
165 <div>
166 <div>
167 <h3 class="title"><a id="idp6121656"></a>See Also</h3>
168 </div>
169 </div>
170 </div>
171 <p>
172 <a class="xref" href="dbc.html#dbclist" title="Database Cursors and Related Methods">Database Cursors and Related Methods</a>
173 </p>
174 </div>
175 </div>
176 <div class="navfooter">
177 <hr />
178 <table width="100%" summary="Navigation footer">
179 <tr>
180 <td width="40%" align="left"><a accesskey="p" href="dbcursor.html">Prev</a> </td>
181 <td width="20%" align="center">
182 <a accesskey="u" href="dbc.html">Up</a>
183 </td>
184 <td width="40%" align="right"> <a accesskey="n" href="dbccmp.html">Next</a></td>
185 </tr>
186 <tr>
187 <td width="40%" align="left" valign="top">Db::cursor() </td>
188 <td width="20%" align="center">
189 <a accesskey="h" href="index.html">Home</a>
190 </td>
191 <td width="40%" align="right" valign="top"> Dbc::cmp()</td>
192 </tr>
193 </table>
194 </div>
195 </body>
196 </html>