Skip to Main Content

Berkeley DB Family

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

DB_THREAD flag with variable length records

601087Nov 5 2009 — edited Nov 5 2009
Hi,

I am currently using the Berkeley DB version 4.7.25.
The databases are created with the DB_THREAD flag.

This version mandates specifying the key/data DBT flags to be set to DB_DBT_USERMEM while reading from the DB opened with the DB_THREAD flag.
When application data structures contain pointers, how would they read data from such DBs?

For reading records into struct that have pointers, the examples just memset the data DBT to 0 and call appropriate DB->get or Cursor->c_get APIs.
This gives an error when the DB is opened with the DB_THREAD flag as follows

"DB_THREAD mandates memory allocation flag on data DBT" and return Error is "Invalid Argument"

And if the data DBT flag is set to DB_DBT_USERMEM, it gives an error

"DB_BUFFER_SMALL: User memory too small for return value"

Should variable record length databases always be created without the DB_THREAD flag?

-- If yes, I dint see this anywhere in the documentation.

Regards,
Ravi Nathwani
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 3 2009
Added on Nov 5 2009
1 comment
2,417 views