When using the cursor Berkeley DB calls to retrieve key/data items under the C/C++ APIs (for example, ), the memory to which the pointer stored into the DBT refers is only valid until the next call to Berkeley DB using the returned by DB->cursor().