dbTalk Databases Forums  

Db::get() hangup

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


Discuss Db::get() hangup in the comp.databases.berkeley-db forum.



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

Default Db::get() hangup - 06-16-2006 , 06:40 PM






Good evening, gentelmen.

I have one database simultaneously accessed by few processes. All of
them are performing reading/writing. After some time all working
processes are hunging up on Db::get(). db_stat-4.2 -h /path/to/home -d
database hangs up too, but the same command w/o -h key works properly.

I'm absolutely sure, that problem is in my misunderstanding or misuse
of environment. I'm always opening it with following flags: DB_CREATE |
DB_INIT_LOCK | DB_INIT_MPOOL | DB_INIT_LOG | DB_INIT_TXN. Typical
database open command is following:

db = new Db(&__env, 0);
db->open(0, name.c_str(), 0, DB_RECNO, flags, 0);

where flags are DB_CREATE or 0. Following operation hangs:

db->get(0, &key, &data, 0);

.... in all processes that are using this db home.

What am i doing wrong?


Reply With Quote
  #2  
Old   
Florian Weimer
 
Posts: n/a

Default Re: Db::get() hangup - 06-17-2006 , 02:25 AM






* Mykola Stryebkov:

Quote:
What am i doing wrong?
Have you enabled the deadlock detector?


Reply With Quote
  #3  
Old   
Mykola Stryebkov
 
Posts: n/a

Default Re: Db::get() hangup - 06-17-2006 , 05:19 AM




Florian Weimer wrote:
Quote:
* Mykola Stryebkov:

What am i doing wrong?

Have you enabled the deadlock detector?
No. What's this?



Reply With Quote
  #4  
Old   
Florian Weimer
 
Posts: n/a

Default Re: Db::get() hangup - 06-17-2006 , 06:05 AM



* Mykola Stryebkov:

Quote:
Florian Weimer wrote:
* Mykola Stryebkov:

What am i doing wrong?

Have you enabled the deadlock detector?

No. What's this?
During concurrent access to the database, deadlocks may occur. You
need to handle them in some way. The Berkeley DB reference guide
contains detailed information:

<http://www.sleepycat.com/docs/ref/transapp/deadlock.html>


Reply With Quote
  #5  
Old   
Mykola Stryebkov
 
Posts: n/a

Default Re: Db::get() hangup - 06-17-2006 , 07:32 AM




Florian Weimer wrote:
Quote:
* Mykola Stryebkov:

Florian Weimer wrote:
* Mykola Stryebkov:

What am i doing wrong?

Have you enabled the deadlock detector?

No. What's this?

During concurrent access to the database, deadlocks may occur. You
need to handle them in some way. The Berkeley DB reference guide
contains detailed information:

http://www.sleepycat.com/docs/ref/tr.../deadlock.html
Thanks, I know about deadlocks nature but very new in concurrent BDB
handling. What whould you say about using db_deadlock utility for
resolving occured deadlocks? I'm thinking about use it with -t flag.



Reply With Quote
  #6  
Old   
Florian Weimer
 
Posts: n/a

Default Re: Db::get() hangup - 06-24-2006 , 09:24 AM



* Mykola Stryebkov:

Quote:
During concurrent access to the database, deadlocks may occur. You
need to handle them in some way. The Berkeley DB reference guide
contains detailed information:

http://www.sleepycat.com/docs/ref/tr.../deadlock.html

Thanks, I know about deadlocks nature but very new in concurrent BDB
handling. What whould you say about using db_deadlock utility for
resolving occured deadlocks? I'm thinking about use it with -t flag.
My databases have little contention, so I call DB_ENV->set_lk_detect
and use the internal deadlock detector which runs every time a lock
cannot be obtained.

In an environment with more substantial log contention, using a
separate lock detector thread (or the command line utility, but I try
to make my applications self-contained) is perhaps the better choice.


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.