dbTalk Databases Forums  

locks berkeley db

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


Discuss locks berkeley db in the comp.databases.berkeley-db forum.



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

Default locks berkeley db - 02-23-2006 , 06:37 AM






hi!

i may have multiple threads reading or writing to a berkely db, i am
not using transactions. I wanted to synchronize these accesses. i am
using java btw, so i thought about using synchronized blocks for
database.get and database.put, but i dont know what i object should i
synchronize on. one option was the db name ( i might be accessing more
than one db at a time as well, so there will be multiple db's open with
read/write happening in all of them ).

sorry, if it seems like a stupid question, but this is the first time i
am using databases. any suggestions would be welcome

thanks


Reply With Quote
  #2  
Old   
Ron
 
Posts: n/a

Default Re: locks berkeley db - 02-24-2006 , 10:27 AM






You could look at synchronizing off the database or environment handles
but I'm still not sure what you are trying to accomplish.

I also wonder why you would not just use transactions with locking and
a deadlock detectory.

Ron


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

Default Re: locks berkeley db - 03-01-2006 , 04:15 AM



hi!
i am using transactions now, and my problem seems to be solved. but now
i keep getting another error :
java.lang.OutOfMemoryError: Cannot allocate memory
at com.sleepycat.db.internal.db_javaJNI.DbEnv_open(Na tive Method)
at com.sleepycat.db.internal.DbEnv.open(DbEnv.java:23 5)
at
com.sleepycat.db.EnvironmentConfig.openEnvironment (EnvironmentConfig.java:714)

when i open the environment.

any idea why i get this error.

thanks in advance


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.