| Author |
Message |
Florian Weimer *nix forums Guru
Joined: 19 Feb 2005
Posts: 418
|
Posted: Sat Jun 24, 2006 2:24 pm Post subject:
Re: Db::get() hangup
|
|
|
* 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/transapp/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. |
|
| Back to top |
|
 |
Mykola Stryebkov *nix forums beginner
Joined: 16 Jun 2006
Posts: 3
|
Posted: Sat Jun 17, 2006 12:32 pm Post subject:
Re: Db::get() hangup
|
|
|
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/transapp/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. |
|
| Back to top |
|
 |
Florian Weimer *nix forums Guru
Joined: 19 Feb 2005
Posts: 418
|
Posted: Sat Jun 17, 2006 11:05 am Post subject:
Re: Db::get() hangup
|
|
|
* 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> |
|
| Back to top |
|
 |
Mykola Stryebkov *nix forums beginner
Joined: 16 Jun 2006
Posts: 3
|
Posted: Sat Jun 17, 2006 10:19 am Post subject:
Re: Db::get() hangup
|
|
|
Florian Weimer wrote:
| Quote: | * Mykola Stryebkov:
What am i doing wrong?
Have you enabled the deadlock detector?
|
No. What's this? |
|
| Back to top |
|
 |
Florian Weimer *nix forums Guru
Joined: 19 Feb 2005
Posts: 418
|
Posted: Sat Jun 17, 2006 7:25 am Post subject:
Re: Db::get() hangup
|
|
|
* Mykola Stryebkov:
| Quote: | What am i doing wrong?
|
Have you enabled the deadlock detector? |
|
| Back to top |
|
 |
Mykola Stryebkov *nix forums beginner
Joined: 16 Jun 2006
Posts: 3
|
Posted: Fri Jun 16, 2006 11:40 pm Post subject:
Db::get() hangup
|
|
|
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? |
|
| Back to top |
|
 |
Google
|
|
| Back to top |
|
 |
|