| 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>Retrieved key/data permanence for C/C++</title> |
| 7 | <link rel="stylesheet" href="gettingStarted.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 Programmer's Reference Guide" /> |
| 10 | <link rel="up" href="am_misc.html" title="Chapter 4. Access Method Wrapup" /> |
| 11 | <link rel="prev" href="am_misc_struct.html" title="Storing C/C++ structures/objects" /> |
| 12 | <link rel="next" href="am_misc_error.html" title="Error support" /> |
| 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">Retrieved key/data permanence for C/C++</th> |
| 22 | </tr> |
| 23 | <tr> |
| 24 | <td width="20%" align="left"><a accesskey="p" href="am_misc_struct.html">Prev</a> </td> |
| 25 | <th width="60%" align="center">Chapter 4. |
| 26 | Access Method Wrapup |
| 27 | </th> |
| 28 | <td width="20%" align="right"> <a accesskey="n" href="am_misc_error.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="am_misc_perm"></a>Retrieved key/data permanence for C/C++</h2> |
| 38 | </div> |
| 39 | </div> |
| 40 | </div> |
| 41 | <p>When using the non-cursor Berkeley DB calls to retrieve key/data items under |
| 42 | the C/C++ APIs (for example, <a href="../api_reference/C/dbget.html" class="olink">DB->get()</a>), the memory to which the |
| 43 | pointer stored into the <a href="../api_reference/C/dbt.html" class="olink">DBT</a> refers is only valid until the next |
| 44 | call to Berkeley DB using the <a href="../api_reference/C/db.html" class="olink">DB</a> handle. (This includes <span class="bold"><strong>any</strong></span> |
| 45 | use of the returned <a href="../api_reference/C/db.html" class="olink">DB</a> handle, including by another thread of |
| 46 | control within the process. For this reason, when multiple threads are |
| 47 | using the returned <a href="../api_reference/C/db.html" class="olink">DB</a> handle concurrently, one of the |
| 48 | <a href="../api_reference/C/dbt.html#dbt_DB_DBT_MALLOC" class="olink">DB_DBT_MALLOC</a>, <a href="../api_reference/C/dbt.html#dbt_DB_DBT_REALLOC" class="olink">DB_DBT_REALLOC</a> or <a href="../api_reference/C/dbt.html#dbt_DB_DBT_USERMEM" class="olink">DB_DBT_USERMEM</a> |
| 49 | flags must be specified with any non-cursor <a href="../api_reference/C/dbt.html" class="olink">DBT</a> used for key or |
| 50 | data retrieval.)</p> |
| 51 | <p>When using the cursor Berkeley DB calls to retrieve key/data items under the |
| 52 | C/C++ APIs (for example, <a href="../api_reference/C/dbcget.html" class="olink">DBC->get()</a>), the memory to which the |
| 53 | pointer stored into the <a href="../api_reference/C/dbt.html" class="olink">DBT</a> refers is only valid until the next |
| 54 | call to Berkeley DB using the <a href="../api_reference/C/dbc.html" class="olink">DBC</a> returned by <a href="../api_reference/C/dbcursor.html" class="olink">DB->cursor()</a>.</p> |
| 55 | </div> |
| 56 | <div class="navfooter"> |
| 57 | <hr /> |
| 58 | <table width="100%" summary="Navigation footer"> |
| 59 | <tr> |
| 60 | <td width="40%" align="left"><a accesskey="p" href="am_misc_struct.html">Prev</a> </td> |
| 61 | <td width="20%" align="center"> |
| 62 | <a accesskey="u" href="am_misc.html">Up</a> |
| 63 | </td> |
| 64 | <td width="40%" align="right"> <a accesskey="n" href="am_misc_error.html">Next</a></td> |
| 65 | </tr> |
| 66 | <tr> |
| 67 | <td width="40%" align="left" valign="top">Storing C/C++ structures/objects </td> |
| 68 | <td width="20%" align="center"> |
| 69 | <a accesskey="h" href="index.html">Home</a> |
| 70 | </td> |
| 71 | <td width="40%" align="right" valign="top"> Error support</td> |
| 72 | </tr> |
| 73 | </table> |
| 74 | </div> |
| 75 | </body> |
| 76 | </html> |