dbTalk Databases Forums  

Dbc->get does not work while iterating over the database

comp.databases.berkeley-db comp.databases.berkeley-db


Discuss Dbc->get does not work while iterating over the database in the comp.databases.berkeley-db forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Jerry
 
Posts: n/a

Default Dbc->get does not work while iterating over the database - 03-14-2006 , 01:41 AM






Hi all...

Berkeley 4.4.16 compiled with VC7.1, WinXP

I have encountered a problem while iterating over my database(size
about 765M, more than 760k records).
I am using cursor as the Using Cursors example in C++ Getting Started,
like this:

featureDb->cursor(NULL, &cursorp, 0);
while ((ret = cursorp->get(&key, &data, DB_PREV)) == 0)
{
...........
}

This only have iterated 9089 records and then get stop at cursorp->get,
and only 19567 records while replaced DB_PREV with DB_NEXT. It seems
that cursorp->get has falled into a dead loop.

can anyone tell me why?


Reply With Quote
  #2  
Old   
Michael Cahill
 
Posts: n/a

Default Re: Dbc->get does not work while iterating over the database - 03-14-2006 , 06:06 AM






Hi Jerry,

What do you mean by "then get stop at cursorp->get". Does the call
return a non-zero error code, and if so, which one?

If the call does not return, can you get a stack trace with a debugger?
It could be blocked on a lock, if there is some concurrent activity,
or if some earlier operation was not completed (so that locks are still
being held by an old cursor or transaction).

Regards,
Michael.


Reply With Quote
  #3  
Old   
Jerry
 
Posts: n/a

Default Re: Dbc->get does not work while iterating over the database - 03-14-2006 , 07:34 PM



Thanks Michael.

I meant "cursorp->get" does not return. I was using the release
version of dll and lib, so I could not step into the "get" function.
There has no concurrent user to access my database. I simply opened the
Env and Db, and then tried to iterate over all records. But failed.


Reply With Quote
  #4  
Old   
Michael Cahill
 
Posts: n/a

Default Re: Dbc->get does not work while iterating over the database - 03-14-2006 , 08:05 PM



Hi Jerry,

Does the same code fail if you first run the db_recover utility in the
environment directory?

Regards,
Michael.


Reply With Quote
  #5  
Old   
Jerry
 
Posts: n/a

Default Re: Dbc->get does not work while iterating over the database - 03-15-2006 , 01:21 AM



I rebuild the database and the same code run.

Thanks for your helps.


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.