| 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>DB->set_flags()</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="db.html" title="Chapter 2. The DB Handle" /> |
| 11 | <link rel="prev" href="dbset_feedback.html" title="DB->set_feedback()" /> |
| 12 | <link rel="next" href="dbset_h_compare.html" title="DB->set_h_compare()" /> |
| 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">DB->set_flags()</th> |
| 22 | </tr> |
| 23 | <tr> |
| 24 | <td width="20%" align="left"><a accesskey="p" href="dbset_feedback.html">Prev</a> </td> |
| 25 | <th width="60%" align="center">Chapter 2. |
| 26 | The DB Handle |
| 27 | </th> |
| 28 | <td width="20%" align="right"> <a accesskey="n" href="dbset_h_compare.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="dbset_flags"></a>DB->set_flags()</h2> |
| 38 | </div> |
| 39 | </div> |
| 40 | </div> |
| 41 | <pre class="programlisting">#include <db.h> |
| 42 | |
| 43 | int |
| 44 | DB->set_flags(DB *db, u_int32_t flags); </pre> |
| 45 | <p> |
| 46 | Configure a database. Calling <code class="methodname">DB->set_flags()</code> is additive; there is |
| 47 | no way to clear flags. |
| 48 | </p> |
| 49 | <p> |
| 50 | The <code class="methodname">DB->set_flags()</code> method may not be called after the |
| 51 | <a class="xref" href="dbopen.html" title="DB->open()">DB->open()</a> method is called. |
| 52 | </p> |
| 53 | <p> |
| 54 | The <code class="methodname">DB->set_flags()</code> <span> |
| 55 | <span> |
| 56 | method returns a non-zero error value on failure and 0 on success. |
| 57 | </span> |
| 58 | |
| 59 | </span> |
| 60 | </p> |
| 61 | <div class="sect2" lang="en" xml:lang="en"> |
| 62 | <div class="titlepage"> |
| 63 | <div> |
| 64 | <div> |
| 65 | <h3 class="title"><a id="idp50305448"></a>Parameters</h3> |
| 66 | </div> |
| 67 | </div> |
| 68 | </div> |
| 69 | <div class="sect3" lang="en" xml:lang="en"> |
| 70 | <div class="titlepage"> |
| 71 | <div> |
| 72 | <div> |
| 73 | <h4 class="title"><a id="idp50304344"></a>flags</h4> |
| 74 | </div> |
| 75 | </div> |
| 76 | </div> |
| 77 | <p> |
| 78 | The <span class="bold"><strong>flags</strong></span> parameter must be set to 0 |
| 79 | or by bitwise inclusively <span class="bold"><strong>OR</strong></span>'ing |
| 80 | together one or more of the following values: |
| 81 | |
| 82 | </p> |
| 83 | <p> |
| 84 | <span class="bold"><strong>General</strong></span> |
| 85 | </p> |
| 86 | <p> |
| 87 | The following flags may be specified for any Berkeley DB access |
| 88 | method: |
| 89 | </p> |
| 90 | <div class="itemizedlist"> |
| 91 | <ul type="disc"> |
| 92 | <li> |
| 93 | <p><a id="dbset_flags_DB_CHKSUM"></a> |
| 94 | <code class="literal">DB_CHKSUM</code> |
| 95 | </p> |
| 96 | <p> |
| 97 | Do checksum verification of pages read into the cache from the backing |
| 98 | filestore. Berkeley DB uses the SHA1 Secure Hash Algorithm if |
| 99 | encryption is configured and a general hash algorithm if it is not. |
| 100 | </p> |
| 101 | <p> |
| 102 | Calling <code class="methodname">DB->set_flags()</code> with the DB_CHKSUM flag only affects the |
| 103 | specified <a class="link" href="db.html" title="Chapter 2. The DB Handle">DB</a> handle (and |
| 104 | any other Berkeley DB handles opened within the scope of that handle). |
| 105 | </p> |
| 106 | <p> |
| 107 | If the database already exists when <a class="xref" href="dbopen.html" title="DB->open()">DB->open()</a> |
| 108 | is called, the DB_CHKSUM flag will be ignored. |
| 109 | </p> |
| 110 | </li> |
| 111 | <li> |
| 112 | <p><a id="dbset_flags_DB_ENCRYPT"></a> |
| 113 | <code class="literal">DB_ENCRYPT</code> |
| 114 | </p> |
| 115 | <p> |
| 116 | Encrypt the database using the cryptographic password specified to the |
| 117 | <a class="xref" href="envset_encrypt.html" title="DB_ENV->set_encrypt()">DB_ENV->set_encrypt()</a> or |
| 118 | <a class="xref" href="dbset_encrypt.html" title="DB->set_encrypt()">DB->set_encrypt()</a> |
| 119 | methods. |
| 120 | </p> |
| 121 | <p> |
| 122 | Calling <code class="methodname">DB->set_flags()</code> with the DB_ENCRYPT flag only affects the |
| 123 | specified <a class="link" href="db.html" title="Chapter 2. The DB Handle">DB</a> handle (and |
| 124 | any other Berkeley DB handles opened within the scope of that handle). |
| 125 | </p> |
| 126 | <p> |
| 127 | If the database already exists when <a class="xref" href="dbopen.html" title="DB->open()">DB->open()</a> |
| 128 | is called, the DB_ENCRYPT flag must be the same as the existing database or an error |
| 129 | will be returned. |
| 130 | </p> |
| 131 | <p> |
| 132 | Encrypted databases are not portable between machines of different |
| 133 | byte orders, that is, encrypted databases created on big-endian |
| 134 | machines cannot be read on little-endian machines, and vice versa. |
| 135 | </p> |
| 136 | </li> |
| 137 | <li> |
| 138 | <p><a id="dbset_flags_DB_TXN_NOT_DURABLE"></a> |
| 139 | <code class="literal">DB_TXN_NOT_DURABLE</code> |
| 140 | </p> |
| 141 | <p> |
| 142 | If set, Berkeley DB will not write log records for this database. |
| 143 | This means that updates of this database exhibit the ACI (atomicity, |
| 144 | consistency, and isolation) properties, but not D (durability); that |
| 145 | is, database integrity will be maintained, but if the application or |
| 146 | system fails, integrity will not persist. The database file must be |
| 147 | verified and/or restored from backup after a failure. In order to |
| 148 | ensure integrity after application shut down, the database handles |
| 149 | must be closed without specifying |
| 150 | <a class="link" href="dbclose.html#dbclose_DB_NOSYNC">DB_NOSYNC</a>, or all |
| 151 | database changes must be flushed from the database environment cache |
| 152 | using either the <a class="xref" href="txncheckpoint.html" title="DB_ENV->txn_checkpoint()">DB_ENV->txn_checkpoint()</a> |
| 153 | or <a class="xref" href="mempsync.html" title="DB_ENV->memp_sync()">DB_ENV->memp_sync()</a> |
| 154 | methods. All database handles for a single physical file must set |
| 155 | DB_TXN_NOT_DURABLE, including database handles for different databases |
| 156 | in a physical file. |
| 157 | </p> |
| 158 | <p> |
| 159 | Calling <code class="methodname">DB->set_flags()</code> |
| 160 | with the DB_TXN_NOT_DURABLE flag only affects the |
| 161 | specified <a class="link" href="db.html" title="Chapter 2. The DB Handle">DB</a> |
| 162 | handle (and any other Berkeley DB handles opened |
| 163 | within the scope of that handle). |
| 164 | </p> |
| 165 | </li> |
| 166 | </ul> |
| 167 | </div> |
| 168 | <p> |
| 169 | <span class="bold"><strong>Btree</strong></span> |
| 170 | </p> |
| 171 | <p> |
| 172 | The following flags may be specified for the Btree access method: |
| 173 | </p> |
| 174 | <div class="itemizedlist"> |
| 175 | <ul type="disc"> |
| 176 | <li> |
| 177 | <p><a id="dbset_flags_DB_DUP"></a> |
| 178 | <code class="literal">DB_DUP</code> |
| 179 | </p> |
| 180 | <p> |
| 181 | Permit duplicate data items in the database; that is, insertion when |
| 182 | the key of the key/data pair being inserted already exists in the |
| 183 | database will be successful. The ordering of duplicates in the |
| 184 | database is determined by the order of insertion, unless the ordering |
| 185 | is otherwise specified by use of a cursor operation or a |
| 186 | duplicate sort function. |
| 187 | </p> |
| 188 | <p> |
| 189 | The DB_DUPSORT flag is preferred to DB_DUP for performance reasons. |
| 190 | The DB_DUP flag should only be used by applications wanting to order |
| 191 | duplicate data items manually. |
| 192 | </p> |
| 193 | <p> |
| 194 | Calling <code class="methodname">DB->set_flags()</code> |
| 195 | with the DB_DUP flag affects the database, |
| 196 | including all threads of control accessing the |
| 197 | database. |
| 198 | </p> |
| 199 | <p> |
| 200 | If the database already exists when |
| 201 | <a class="xref" href="dbopen.html" title="DB->open()">DB->open()</a> |
| 202 | is called, the DB_DUP flag must be the same as |
| 203 | the existing database or an error will be |
| 204 | returned. |
| 205 | </p> |
| 206 | <p> |
| 207 | It is an error to specify both DB_DUP and DB_RECNUM. |
| 208 | </p> |
| 209 | </li> |
| 210 | <li> |
| 211 | <p><a id="dbset_flags_DB_DUPSORT"></a> |
| 212 | <code class="literal">DB_DUPSORT</code> |
| 213 | </p> |
| 214 | <p> |
| 215 | Permit duplicate data items in the database; that is, insertion when |
| 216 | the key of the key/data pair being inserted already exists in the |
| 217 | database will be successful. The ordering of duplicates in the |
| 218 | database is determined by the duplicate comparison function. If the |
| 219 | application does not specify a comparison function using the |
| 220 | <a class="xref" href="dbset_dup_compare.html" title="DB->set_dup_compare()">DB->set_dup_compare()</a> |
| 221 | method, a default lexical comparison will be used. It is an error to |
| 222 | specify both DB_DUPSORT and DB_RECNUM. |
| 223 | </p> |
| 224 | <p> |
| 225 | Calling <code class="methodname">DB->set_flags()</code> |
| 226 | with the DB_DUPSORT flag affects the database, |
| 227 | including all threads of control accessing the |
| 228 | database. |
| 229 | </p> |
| 230 | <p> |
| 231 | If the database already exists when |
| 232 | <a class="xref" href="dbopen.html" title="DB->open()">DB->open()</a> |
| 233 | is called, the DB_DUPSORT flag must be the same |
| 234 | as the existing database or an error will be |
| 235 | returned. |
| 236 | </p> |
| 237 | </li> |
| 238 | <li> |
| 239 | <p><a id="dbset_flags_DB_RECNUM"></a> |
| 240 | <code class="literal">DB_RECNUM</code> |
| 241 | </p> |
| 242 | <p> |
| 243 | Support retrieval from the Btree using record numbers. For more |
| 244 | information, see the |
| 245 | <a class="link" href="dbget.html#dbget_DB_SET_RECNO">DB_SET_RECNO</a> |
| 246 | flag to the <a class="xref" href="dbget.html" title="DB->get()">DB->get()</a> and |
| 247 | <a class="xref" href="dbcget.html" title="DBcursor->get()">DBcursor->get()</a> methods. |
| 248 | </p> |
| 249 | <p> |
| 250 | Logical record numbers in Btree databases are mutable in the face of |
| 251 | record insertion or deletion. See the DB_RENUMBER flag in the Recno |
| 252 | access method information for further discussion. |
| 253 | </p> |
| 254 | <p> |
| 255 | Maintaining record counts within a Btree introduces a serious point of |
| 256 | contention, namely the page locations where the record counts are |
| 257 | stored. In addition, the entire database must be locked during both |
| 258 | insertions and deletions, effectively single-threading the database |
| 259 | for those operations. Specifying DB_RECNUM can result in serious |
| 260 | performance degradation for some applications and data sets. |
| 261 | </p> |
| 262 | <p> |
| 263 | It is an error to specify both DB_DUP and DB_RECNUM. |
| 264 | </p> |
| 265 | <p> |
| 266 | Calling <code class="methodname">DB->set_flags()</code> with the DB_RECNUM flag affects the database, |
| 267 | including all threads of control accessing the database. |
| 268 | </p> |
| 269 | <p> |
| 270 | If the database already exists when <a class="xref" href="dbopen.html" title="DB->open()">DB->open()</a> |
| 271 | is called, the DB_RECNUM flag must be the same as the existing database or an error |
| 272 | will be returned. |
| 273 | </p> |
| 274 | </li> |
| 275 | <li> |
| 276 | <p><a id="dbset_flags_DB_REVSPLITOFF"></a> |
| 277 | <code class="literal">DB_REVSPLITOFF</code> |
| 278 | </p> |
| 279 | <p> |
| 280 | Turn off reverse splitting in the Btree. As pages are emptied in a |
| 281 | database, the Berkeley DB Btree implementation attempts to coalesce |
| 282 | empty pages into higher-level pages in order to keep the database as |
| 283 | small as possible and minimize search time. This can hurt performance |
| 284 | in applications with cyclical data demands; that is, applications |
| 285 | where the database grows and shrinks repeatedly. For example, because |
| 286 | Berkeley DB does page-level locking, the maximum level of concurrency |
| 287 | in a database of two pages is far smaller than that in a database of |
| 288 | 100 pages, so a database that has shrunk to a minimal size can cause |
| 289 | severe deadlocking when a new cycle of data insertion begins. |
| 290 | </p> |
| 291 | <p> |
| 292 | Calling <code class="methodname">DB->set_flags()</code> |
| 293 | with the DB_REVSPLITOFF flag only affects the |
| 294 | specified <a class="link" href="db.html" title="Chapter 2. The DB Handle">DB</a> |
| 295 | handle (and any other Berkeley DB handles opened |
| 296 | within the scope of that handle). |
| 297 | </p> |
| 298 | </li> |
| 299 | </ul> |
| 300 | </div> |
| 301 | <p> |
| 302 | <span class="bold"><strong>Hash</strong></span> |
| 303 | </p> |
| 304 | <p> |
| 305 | The following flags may be specified for the Hash access method: |
| 306 | </p> |
| 307 | <div class="itemizedlist"> |
| 308 | <ul type="disc"> |
| 309 | <li> |
| 310 | <p><a id="dbset_flags_h_DB_DUP"></a> |
| 311 | <code class="literal">DB_DUP</code> |
| 312 | </p> |
| 313 | <p> |
| 314 | Permit duplicate data items in the database; that is, insertion when |
| 315 | the key of the key/data pair being inserted already exists in the |
| 316 | database will be successful. The ordering of duplicates in the |
| 317 | database is determined by the order of insertion, unless the ordering |
| 318 | is otherwise specified by use of a cursor operation. |
| 319 | </p> |
| 320 | <p> |
| 321 | The DB_DUPSORT flag is preferred to DB_DUP for performance reasons. |
| 322 | The DB_DUP flag should only be used by applications wanting to order |
| 323 | duplicate data items manually. |
| 324 | </p> |
| 325 | <p> |
| 326 | Calling <code class="methodname">DB->set_flags()</code> with the DB_DUP flag affects the database, |
| 327 | including all threads of control accessing the database. |
| 328 | </p> |
| 329 | <p> |
| 330 | If the database already exists when <a class="xref" href="dbopen.html" title="DB->open()">DB->open()</a> |
| 331 | is called, the DB_DUP flag must be the same as the existing database or an error will be |
| 332 | returned. |
| 333 | </p> |
| 334 | </li> |
| 335 | <li> |
| 336 | <p> |
| 337 | <code class="literal">DB_DUPSORT</code> |
| 338 | </p> |
| 339 | <p> |
| 340 | Permit duplicate data items in the database; that is, insertion when |
| 341 | the key of the key/data pair being inserted already exists in the |
| 342 | database will be successful. The ordering of duplicates in the |
| 343 | database is determined by the duplicate comparison function. If the |
| 344 | application does not specify a comparison function using the |
| 345 | <a class="xref" href="dbset_dup_compare.html" title="DB->set_dup_compare()">DB->set_dup_compare()</a> |
| 346 | method, a default lexical comparison will be used. |
| 347 | </p> |
| 348 | <p> |
| 349 | Calling <code class="methodname">DB->set_flags()</code> with the DB_DUPSORT flag affects the |
| 350 | database, including all threads of control accessing the database. |
| 351 | </p> |
| 352 | <p> |
| 353 | If the database already exists when <a class="xref" href="dbopen.html" title="DB->open()">DB->open()</a> |
| 354 | is called, the DB_DUPSORT flag must be the same as the existing database or an error |
| 355 | will be returned. |
| 356 | </p> |
| 357 | </li> |
| 358 | <li> |
| 359 | <p><a id="dbset_flags_hash_DB_REVSPLITOFF"></a> |
| 360 | <code class="literal">DB_REVSPLITOFF</code> |
| 361 | </p> |
| 362 | <p> |
| 363 | Turns off hash bucket compaction. When a hash bucket is |
| 364 | emptied, the Berkeley DB Hash implementation will decrease |
| 365 | the hash table size, coalescing buckets. This will |
| 366 | decrease the number of pages in the database. |
| 367 | This can hurt performance in applications with cyclical |
| 368 | data demands — that is, applications where the |
| 369 | database grows and shrinks repeatedly — because of |
| 370 | the cost of resplitting buckets when they grow again. |
| 371 | </p> |
| 372 | <p> |
| 373 | Calling <code class="methodname">DB->set_flags()</code> with the |
| 374 | DB_REVSPLITOFF flag only affects the |
| 375 | specified <a class="link" href="db.html" title="Chapter 2. The DB Handle">DB</a> handle (and |
| 376 | any other Berkeley DB handles opened within the scope of that handle). |
| 377 | </p> |
| 378 | </li> |
| 379 | </ul> |
| 380 | </div> |
| 381 | <p> |
| 382 | <span class="bold"><strong>Queue</strong></span> |
| 383 | </p> |
| 384 | <p> |
| 385 | The following flags may be specified for the Queue access method: |
| 386 | </p> |
| 387 | <div class="itemizedlist"> |
| 388 | <ul type="disc"> |
| 389 | <li> |
| 390 | <p> |
| 391 | <code class="literal">DB_INORDER</code> |
| 392 | </p> |
| 393 | <p> |
| 394 | The DB_INORDER flag modifies the operation of the |
| 395 | <a class="link" href="dbget.html#dbget_DB_CONSUME">DB_CONSUME</a> or |
| 396 | <a class="link" href="dbget.html#dbget_DB_CONSUME_WAIT">DB_CONSUME_WAIT</a> |
| 397 | flags to <a class="xref" href="dbget.html" title="DB->get()">DB->get()</a> to |
| 398 | return key/data pairs in order. That is, they will always return the |
| 399 | key/data item from the head of the queue. |
| 400 | </p> |
| 401 | <p> |
| 402 | The default behavior of queue databases is optimized for multiple |
| 403 | readers, and does not guarantee that record will be retrieved in the |
| 404 | order they are added to the queue. Specifically, if a writing thread |
| 405 | adds multiple records to an empty queue, reading threads may skip some |
| 406 | of the initial records when the next <a class="xref" href="dbget.html" title="DB->get()">DB->get()</a> |
| 407 | call returns. |
| 408 | </p> |
| 409 | <p> |
| 410 | This flag modifies the <a class="xref" href="dbget.html" title="DB->get()">DB->get()</a> |
| 411 | call to verify that the record being returned is in fact the head of the queue. This will |
| 412 | increase contention and reduce concurrency when there are many reading threads. |
| 413 | </p> |
| 414 | <p> |
| 415 | Calling <code class="methodname">DB->set_flags()</code> with the DB_INORDER flag only affects the |
| 416 | specified <a class="link" href="db.html" title="Chapter 2. The DB Handle">DB</a> handle (and |
| 417 | any other Berkeley DB handles opened within the scope of that handle). |
| 418 | </p> |
| 419 | </li> |
| 420 | </ul> |
| 421 | </div> |
| 422 | <p> |
| 423 | <span class="bold"><strong>Recno</strong></span> |
| 424 | </p> |
| 425 | <p> |
| 426 | The following flags may be specified for the Recno access method: |
| 427 | </p> |
| 428 | <div class="itemizedlist"> |
| 429 | <ul type="disc"> |
| 430 | <li> |
| 431 | <p><a id="dbset_flags_DB_RENUMBER"></a> |
| 432 | <code class="literal">DB_RENUMBER</code> |
| 433 | </p> |
| 434 | <p> |
| 435 | Specifying the DB_RENUMBER flag causes the logical record numbers to |
| 436 | be mutable, and change as records are added to and deleted from the |
| 437 | database. |
| 438 | </p> |
| 439 | <p> |
| 440 | Using the <a class="xref" href="dbput.html" title="DB->put()">DB->put()</a> or |
| 441 | <a class="xref" href="dbcput.html" title="DBcursor->put()">DBcursor->put()</a> interfaces |
| 442 | to create new records will cause the creation of multiple records if |
| 443 | the record number is more than one greater than the largest record |
| 444 | currently in the database. For example, creating record 28, when |
| 445 | record 25 was previously the last record in the database, will create |
| 446 | records 26 and 27 as well as 28. Attempts to retrieve records that |
| 447 | were created in this manner will result in an error return of <a href="../../programmer_reference/program_errorret.html#program_errorret.DB_KEYEMPTY" class="olink">DB_KEYEMPTY</a>. |
| 448 | </p> |
| 449 | <p> |
| 450 | If a created record is not at the end of the database, all records |
| 451 | following the new record will be automatically renumbered upward by |
| 452 | one. For example, the creation of a new record numbered 8 causes |
| 453 | records numbered 8 and greater to be renumbered upward by one. If a |
| 454 | cursor was positioned to record number 8 or greater before the |
| 455 | insertion, it will be shifted upward one logical record, continuing to |
| 456 | refer to the same record as it did before. |
| 457 | </p> |
| 458 | <p> |
| 459 | If a deleted record is not at the end of the database, all records |
| 460 | following the removed record will be automatically renumbered downward |
| 461 | by one. For example, deleting the record numbered 8 causes records |
| 462 | numbered 9 and greater to be renumbered downward by one. If a |
| 463 | cursor was positioned to record number 9 or greater before the |
| 464 | removal, it will be shifted downward one logical record, continuing to |
| 465 | refer to the same record as it did before. |
| 466 | </p> |
| 467 | <p> |
| 468 | If a record is deleted, all cursors that were positioned on that record |
| 469 | prior to the removal will no longer be positioned on a valid entry. |
| 470 | This includes cursors used to delete an item. For example, if |
| 471 | a cursor was positioned to record number 8 before the removal of |
| 472 | that record, subsequent calls to <a class="xref" href="dbcget.html" title="DBcursor->get()">DBcursor->get()</a> |
| 473 | with flags of DB_CURRENT will result in an error return of |
| 474 | <a href="../../programmer_reference/program_errorret.html#program_errorret.DB_KEYEMPTY" class="olink">DB_KEYEMPTY</a> |
| 475 | until the cursor is moved to another record. A call to |
| 476 | <a class="xref" href="dbcget.html" title="DBcursor->get()">DBcursor->get()</a> with flags of DB_NEXT |
| 477 | will return the new record numbered 8 - which is the record that was |
| 478 | numbered 9 prior to the delete (if such a record existed). |
| 479 | </p> |
| 480 | <p> |
| 481 | For these reasons, concurrent access to a Recno database with the |
| 482 | DB_RENUMBER flag specified may be largely meaningless, although it is |
| 483 | supported. |
| 484 | </p> |
| 485 | <p> |
| 486 | Calling <code class="methodname">DB->set_flags()</code> with the DB_RENUMBER flag affects the |
| 487 | database, including all threads of control accessing the database. |
| 488 | </p> |
| 489 | <p> |
| 490 | If the database already exists when <a class="xref" href="dbopen.html" title="DB->open()">DB->open()</a> |
| 491 | is called, the DB_RENUMBER flag must be the same as the existing database or an error |
| 492 | will be returned. |
| 493 | </p> |
| 494 | </li> |
| 495 | <li> |
| 496 | <p><a id="dbset_flags_DB_SNAPSHOT"></a> |
| 497 | <code class="literal">DB_SNAPSHOT</code> |
| 498 | </p> |
| 499 | <p> |
| 500 | This flag specifies that any specified <span class="bold"><strong>re_source</strong></span> file be read in its entirety when |
| 501 | <a class="xref" href="dbopen.html" title="DB->open()">DB->open()</a> is called. If |
| 502 | this flag is not specified, the <span class="bold"><strong>re_source</strong></span> file may be read lazily. |
| 503 | </p> |
| 504 | <p> |
| 505 | See the <a class="xref" href="dbset_re_source.html" title="DB->set_re_source()">DB->set_re_source()</a> |
| 506 | method for information on the <span class="bold"><strong>re_source</strong></span> file. |
| 507 | </p> |
| 508 | <p> |
| 509 | Calling <code class="methodname">DB->set_flags()</code> with the DB_SNAPSHOT flag only affects the |
| 510 | specified <a class="link" href="db.html" title="Chapter 2. The DB Handle">DB</a> handle (and |
| 511 | any other Berkeley DB handles opened within the scope of that handle). |
| 512 | </p> |
| 513 | </li> |
| 514 | </ul> |
| 515 | </div> |
| 516 | </div> |
| 517 | </div> |
| 518 | <div class="sect2" lang="en" xml:lang="en"> |
| 519 | <div class="titlepage"> |
| 520 | <div> |
| 521 | <div> |
| 522 | <h3 class="title"><a id="idp50303976"></a>Errors</h3> |
| 523 | </div> |
| 524 | </div> |
| 525 | </div> |
| 526 | <p> |
| 527 | The <code class="methodname">DB->set_flags()</code> <span> |
| 528 | <span> |
| 529 | method may fail and return one of the following non-zero errors: |
| 530 | </span> |
| 531 | |
| 532 | </span> |
| 533 | </p> |
| 534 | <div class="sect3" lang="en" xml:lang="en"> |
| 535 | <div class="titlepage"> |
| 536 | <div> |
| 537 | <div> |
| 538 | <h4 class="title"><a id="idp50320440"></a>EINVAL</h4> |
| 539 | </div> |
| 540 | </div> |
| 541 | </div> |
| 542 | <p> |
| 543 | An invalid flag value or parameter was specified. |
| 544 | </p> |
| 545 | </div> |
| 546 | </div> |
| 547 | <div class="sect2" lang="en" xml:lang="en"> |
| 548 | <div class="titlepage"> |
| 549 | <div> |
| 550 | <div> |
| 551 | <h3 class="title"><a id="idp50345456"></a>Class</h3> |
| 552 | </div> |
| 553 | </div> |
| 554 | </div> |
| 555 | <p> |
| 556 | <a class="link" href="db.html" title="Chapter 2. The DB Handle">DB</a> |
| 557 | </p> |
| 558 | </div> |
| 559 | <div class="sect2" lang="en" xml:lang="en"> |
| 560 | <div class="titlepage"> |
| 561 | <div> |
| 562 | <div> |
| 563 | <h3 class="title"><a id="idp50309104"></a>See Also</h3> |
| 564 | </div> |
| 565 | </div> |
| 566 | </div> |
| 567 | <p> |
| 568 | <a class="xref" href="db.html#dblist" title="Database and Related Methods">Database and Related Methods</a> |
| 569 | </p> |
| 570 | </div> |
| 571 | </div> |
| 572 | <div class="navfooter"> |
| 573 | <hr /> |
| 574 | <table width="100%" summary="Navigation footer"> |
| 575 | <tr> |
| 576 | <td width="40%" align="left"><a accesskey="p" href="dbset_feedback.html">Prev</a> </td> |
| 577 | <td width="20%" align="center"> |
| 578 | <a accesskey="u" href="db.html">Up</a> |
| 579 | </td> |
| 580 | <td width="40%" align="right"> <a accesskey="n" href="dbset_h_compare.html">Next</a></td> |
| 581 | </tr> |
| 582 | <tr> |
| 583 | <td width="40%" align="left" valign="top">DB->set_feedback() </td> |
| 584 | <td width="20%" align="center"> |
| 585 | <a accesskey="h" href="index.html">Home</a> |
| 586 | </td> |
| 587 | <td width="40%" align="right" valign="top"> DB->set_h_compare()</td> |
| 588 | </tr> |
| 589 | </table> |
| 590 | </div> |
| 591 | </body> |
| 592 | </html> |