dbTalk Databases Forums  

Db.put hangs in single threaded application

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


Discuss Db.put hangs in single threaded application in the comp.databases.berkeley-db forum.



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

Default Db.put hangs in single threaded application - 01-19-2006 , 06:59 PM






Hi,

1) I'm using BerkeleyDB 4.4.20 through Java. That is, I access the DB
through the Java Swig wrappers.

2) There is only one thread accessing the DB in my application.

3) My DB is created as follows:

dbConfig = new DatabaseConfig();
dbConfig.setAllowCreate(true);
dbConfig.setSortedDuplicates(true);
dbConfig.setType(DatabaseType.BTREE);
incidence_db = env.openDatabase(null, INCIDENCE_DB_NAME,
null, dbConfig);

4) A fair amount of data gets added to this 'incidence_db' where each
key may potentially have many duplicates.

5) Both keys and values are 16 byte UUIDs.

6) I tried inserting the key/value on which it hang using a reduced
data set and it worked. So it doesn't seem dependent on the actual
key/value pair.

7) Same problem with Berkeley DB 4.3....

Any indication how I may track down the issue?

Thanks a lot in advance!
Borislav


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

Default Re: Db.put hangs in single threaded application - 01-19-2006 , 07:50 PM






Hi Borislav,

Is the environment configured for locking? If so, can you check
whether the thread blocks waiting on a lock (using 'db_stat -Co' in the
environment directory).

Alternatively, can you attach a debugger to the process when it hangs
and get a stack trace?

Regards,
Michael.


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

Default Re: Db.put hangs in single threaded application - 01-20-2006 , 09:34 AM



Hi Michael,

Thanks! Seems like there lies the problem:

Locks grouped by object:
Locker Mode Count Status ----------------- Object
---------------
33 READ 1 HELD incidencedb page
58
4 READ 1 HELD incidencedb page
58
2b WRITE 1 WAIT incidencedb page
58

2b READ 1 HELD incidencedb page
1

it's waiting on a locker, but why would that be? The environment is
configured for locking because it will eventually be accessed from
multiple threads (even though in this particular instance, it isn't).
Here is the configuration:

EnvironmentConfig envConfig = new EnvironmentConfig();
envConfig.setAllowCreate(true);
envConfig.setInitializeCache(true);
envConfig.setInitializeLocking(true);
envConfig.setInitializeLogging(true);


Could then this mean that I haven't closed some cursor on that DB
properly?

Thanks!
Borislav


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.