Click to See Complete Forum and Search --> : Berkeley DB's Queue DB problem


xuzzzhen123
September 3rd, 2005, 01:24 AM
Hi all,
In Berkeley DB, How can I store and retrieve records in queue type in Berkeley DB?.
If I want to use dbp->put(dbp, NULL, &key, &data, DB_APPEND); API to append an element to the queue type what is the value I should pass to the key field?

And how can I retrieve the storedrecords?

Any examples availabe?

My MSN & Mail: xuzzzhen123@hotmail.com

olivthill
September 3rd, 2005, 04:02 AM
The DB->put() method stores key/data pairs in the database.

If the database supports duplicates, then the key can be the same for different DB->put().

In the key, I would put "queue" or a record number.

See exemples at:

http://www.sleepycat.com/docs/ref/am_conf/logrec.html
http://pybsddb.sourceforge.net/ref/simple_tut/put.html
http://www.datalab.uci.edu/people/xge/mlword/node9.html