niagara_man (AT) hotmail (DOT) com (Derick Smith) wrote in message news:<99805581.0309300618.549f9c1b (AT) posting (DOT) google.com>...
Quote:
Is is possible to put the DBT in a struct, then declare an array of
DBTs? This array will be declared dynamically.
I want to call DBcursor->c_get and DB->get multiple times and store
the result(s) in this structure. Then close the cursors. |
The documentation you should review is the "Retrieved key/data
permanence for C/C++" section of the Berkeley DB Reference
Guide, included in your download package and also available at:
http://www.sleepycat.com/docs/ref/am_misc/perm.html
Basically, if Berkeley DB is managing the memory used to store
returned key/data pairs, that memory may be re-used as soon as
the next call made to Berkeley DB using the handle for which
the key/data pair was returned.
Of course, if you use the DB_DBT_{MALLOC,REALLOC,USERMEM} flags,
then the memory holding the returned key/data pairs is owned by
the application, and is available until the application decides
to reclaim it.
Regards,
--keith
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Keith Bostic bostic (AT) sleepycat (DOT) com
Sleepycat Software Inc. keithbosticim (ymsgid)
118 Tower Rd. +1-781-259-3139
Lincoln, MA 01773 http://www.sleepycat.com