Debian Codegraph @

docs/api_reference/CXX/envdbremove.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>DbEnv::dbremove()</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="env.html" title="Chapter 5.  The DbEnv Handle" />
11 <link rel="prev" href="envdbbackup.html" title="DbEnv::dbbackup()" />
12 <link rel="next" href="envdbrename.html" title="DbEnv::dbrename()" />
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">DbEnv::dbremove()</th>
22 </tr>
23 <tr>
24 <td width="20%" align="left"><a accesskey="p" href="envdbbackup.html">Prev</a> </td>
25 <th width="60%" align="center">Chapter 5. 
26 The DbEnv Handle
27 </th>
28 <td width="20%" align="right"> <a accesskey="n" href="envdbrename.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="envdbremove"></a>DbEnv::dbremove()</h2>
38 </div>
39 </div>
40 </div>
41 <pre class="programlisting">#include &lt;db_cxx.h&gt;
42
43 int
44 DbEnv::dbremove(DbTxn *txnid,
45 const char *file, const char *database, u_int32_t flags);</pre>
46 <p>
47 The <code class="methodname">DbEnv::dbremove()</code> method removes the database specified by the
48 <span class="bold"><strong>file</strong></span> and <span class="bold"><strong>database</strong></span> parameters. If no <span class="bold"><strong>database</strong></span> is specified, the underlying file
49 represented by <span class="bold"><strong>file</strong></span> is removed,
50 incidentally removing all of the databases it contained.
51 </p>
52 <p>
53 Applications should never remove databases with open
54 <a class="link" href="db.html" title="Chapter 2.  The Db Handle">Db</a> handles, or in the case of
55 removing a file, when any database in the file has an open handle.
56 </p>
57 <p>
58 The <code class="methodname">DbEnv::dbremove()</code> <span>
59
60 <span>
61 method either returns a non-zero error value or throws an
62 exception that encapsulates a non-zero error value on
63 failure, and returns 0 on success.
64 </span>
65 </span>
66 </p>
67 <p>
68 <code class="methodname">DbEnv::dbremove()</code> is affected by any database directory specified using the
69 <a class="xref" href="envset_data_dir.html" title="DbEnv::set_data_dir()">DbEnv::set_data_dir()</a>
70 method, or by setting the <code class="literal">set_data_dir</code> string in the environment's
71 <a href="../../programmer_reference/env_db_config.html#env_db_config.DB_CONFIG" class="olink">DB_CONFIG</a> file.
72 </p>
73 <div class="sect2" lang="en" xml:lang="en">
74 <div class="titlepage">
75 <div>
76 <div>
77 <h3 class="title"><a id="idp6682736"></a>Parameters</h3>
78 </div>
79 </div>
80 </div>
81 <div class="sect3" lang="en" xml:lang="en">
82 <div class="titlepage">
83 <div>
84 <div>
85 <h4 class="title"><a id="idp6682928"></a>txnid</h4>
86 </div>
87 </div>
88 </div>
89 <p>
90 If the operation is part of an application-specified transaction, the
91 <span class="bold"><strong>txnid</strong></span> parameter is a transaction
92 handle returned from
93 <a class="xref" href="txnbegin.html" title="DbEnv::txn_begin()">DbEnv::txn_begin()</a>; if the
94 operation is part of a Berkeley DB Concurrent Data Store group, the
95 <span class="bold"><strong>txnid</strong></span> parameter is a handle returned
96 from <a class="xref" href="envcdsgroup_begin.html" title="DbEnv::cdsgroup_begin()">DbEnv::cdsgroup_begin()</a>;
97 otherwise NULL. If no transaction handle is specified, but the
98 <code class="literal">DB_AUTO_COMMIT</code> flag is specified to either this method
99 or the environment handle, the operation will be implicitly transaction protected.
100 </p>
101 </div>
102 <div class="sect3" lang="en" xml:lang="en">
103 <div class="titlepage">
104 <div>
105 <div>
106 <h4 class="title"><a id="idp6683984"></a>file</h4>
107 </div>
108 </div>
109 </div>
110 <p>
111 The <span class="bold"><strong>file</strong></span> parameter is the physical
112 file which contains the database(s) to be removed.
113 </p>
114 </div>
115 <div class="sect3" lang="en" xml:lang="en">
116 <div class="titlepage">
117 <div>
118 <div>
119 <h4 class="title"><a id="idp6649912"></a>database</h4>
120 </div>
121 </div>
122 </div>
123 <p>
124 The <span class="bold"><strong>database</strong></span> parameter is the
125 database to be removed.
126 </p>
127 </div>
128 <div class="sect3" lang="en" xml:lang="en">
129 <div class="titlepage">
130 <div>
131 <div>
132 <h4 class="title"><a id="idp6662328"></a>flags</h4>
133 </div>
134 </div>
135 </div>
136 <p>
137 The <span class="bold"><strong>flags</strong></span> parameter must
138 be set to 0 or the following value:
139 </p>
140 <div class="itemizedlist">
141 <ul type="disc">
142 <li>
143 <p>
144 <code class="literal">DB_AUTO_COMMIT</code>
145 </p>
146 <p>
147 Enclose the <code class="classname">DbEnv::dbremove()</code>
148 call within a transaction. If the call succeeds,
149 changes made by the operation will be recoverable.
150 If the call fails, the operation will have made no
151 changes.
152 </p>
153 </li>
154 </ul>
155 </div>
156 </div>
157 </div>
158 <div class="sect2" lang="en" xml:lang="en">
159 <div class="titlepage">
160 <div>
161 <div>
162 <h3 class="title"><a id="idp6690064"></a>Environment Variables</h3>
163 </div>
164 </div>
165 </div>
166 <p>
167 The environment variable <code class="literal">DB_HOME</code> may be used as the path of
168 the database environment home.
169 </p>
170 </div>
171 <div class="sect2" lang="en" xml:lang="en">
172 <div class="titlepage">
173 <div>
174 <div>
175 <h3 class="title"><a id="idp6683360"></a>Errors</h3>
176 </div>
177 </div>
178 </div>
179 <p>
180 The <code class="methodname">DbEnv::dbremove()</code> <span>
181
182 <span>
183 method may fail and throw a <a class="link" href="dbexception.html" title="Chapter 6. The DbException Class">DbException</a>
184 exception, encapsulating one of the following non-zero errors, or return one
185 of the following non-zero errors:
186 </span>
187 </span>
188 </p>
189 <div class="sect3" lang="en" xml:lang="en">
190 <div class="titlepage">
191 <div>
192 <div>
193 <h4 class="title"><a id="idp6698904"></a><span>DbDeadlockException or </span>DB_LOCK_DEADLOCK</h4>
194 </div>
195 </div>
196 </div>
197 <p>
198 A transactional database environment operation was selected to resolve
199 a deadlock.
200 </p>
201 <p>
202 <a class="xref" href="dbdeadlock.html" title="DbDeadlockException">DbDeadlockException</a> is thrown if
203 your Berkeley DB API is configured to throw exceptions.
204 Otherwise, <code class="literal">DB_LOCK_DEADLOCK</code> is returned.
205 </p>
206 </div>
207 <div class="sect3" lang="en" xml:lang="en">
208 <div class="titlepage">
209 <div>
210 <div>
211 <h4 class="title"><a id="idp6684912"></a><span>DbLockNotGrantedException or </span>DB_LOCK_NOTGRANTED</h4>
212 </div>
213 </div>
214 </div>
215 <p>
216 A Berkeley DB Concurrent Data Store database environment configured
217 for lock timeouts was unable to grant a lock in the allowed time.
218 </p>
219 <p>
220 You attempted to open a database handle that is configured
221 for no waiting exclusive locking, but the exclusive lock could not be
222 immediately obtained. See
223 <a class="xref" href="dbset_lk_exclusive.html" title="Db::set_lk_exclusive()">Db::set_lk_exclusive()</a>
224 for more information.
225 </p>
226 <p>
227 <a class="xref" href="dblocknotgranted.html" title="DbLockNotGrantedException">DbLockNotGrantedException</a> is thrown if
228 your Berkeley DB API is configured to throw exceptions.
229 Otherwise, <code class="literal">DB_LOCK_NOTGRANTED</code> is returned.
230 </p>
231 </div>
232 <div class="sect3" lang="en" xml:lang="en">
233 <div class="titlepage">
234 <div>
235 <div>
236 <h4 class="title"><a id="idp6640056"></a>EINVAL</h4>
237 </div>
238 </div>
239 </div>
240 <p>
241 If the method was called before <a class="xref" href="envopen.html" title="DbEnv::open()">DbEnv::open()</a>
242 was called; or if an invalid flag value or parameter was specified.
243 </p>
244 </div>
245 <div class="sect3" lang="en" xml:lang="en">
246 <div class="titlepage">
247 <div>
248 <div>
249 <h4 class="title"><a id="idp6676520"></a>ENOENT</h4>
250 </div>
251 </div>
252 </div>
253 <p>
254 The file or directory does not exist.
255 </p>
256 </div>
257 </div>
258 <div class="sect2" lang="en" xml:lang="en">
259 <div class="titlepage">
260 <div>
261 <div>
262 <h3 class="title"><a id="idp6694456"></a>Class</h3>
263 </div>
264 </div>
265 </div>
266 <p>
267 <a class="link" href="env.html" title="Chapter 5.  The DbEnv Handle">DbEnv</a>
268 </p>
269 </div>
270 <div class="sect2" lang="en" xml:lang="en">
271 <div class="titlepage">
272 <div>
273 <div>
274 <h3 class="title"><a id="idp6685448"></a>See Also</h3>
275 </div>
276 </div>
277 </div>
278 <p>
279 <a class="xref" href="env.html#envlist" title="Database Environments and Related Methods">Database Environments and Related Methods</a>
280 </p>
281 </div>
282 </div>
283 <div class="navfooter">
284 <hr />
285 <table width="100%" summary="Navigation footer">
286 <tr>
287 <td width="40%" align="left"><a accesskey="p" href="envdbbackup.html">Prev</a> </td>
288 <td width="20%" align="center">
289 <a accesskey="u" href="env.html">Up</a>
290 </td>
291 <td width="40%" align="right"> <a accesskey="n" href="envdbrename.html">Next</a></td>
292 </tr>
293 <tr>
294 <td width="40%" align="left" valign="top">DbEnv::dbbackup() </td>
295 <td width="20%" align="center">
296 <a accesskey="h" href="index.html">Home</a>
297 </td>
298 <td width="40%" align="right" valign="top"> DbEnv::dbrename()</td>
299 </tr>
300 </table>
301 </div>
302 </body>
303 </html>