DB_THREAD flag with variable length records
601087Nov 5 2009 — edited Nov 5 2009Hi,
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