dbTalk Databases Forums  

How do they work read lock, write lock, dead lock ?

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


Discuss How do they work read lock, write lock, dead lock ? in the comp.databases.berkeley-db forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
intmail01@gmail.com
 
Posts: n/a

Default How do they work read lock, write lock, dead lock ? - 11-17-2006 , 10:10 AM






Hello,

I am writing to ask about locking mechanism.

Somwhere in docs I found that a "deadlock" can bring application to
crash. I built my application with multiple reader an multiple writer
on the single database. In this case each reader open at least two
cursor to read and does not close it until they close application.

Each user may open one cursor at most to change record.

My problem is to indentify when deadlock will occur ?

Docs say two process accessing the same data each other cause circular
deadlock.

If some one could explain me some mechanism of locking in berkeley db:

- When read lock and write lock appears ?
- When I open a cursor (without "write" flag) then I move it in a
particular record. Does this record locked ? One time I erase a record
that is pointed by an another user cursor but no crash occurs; all
works fine.
- When a read or write lock are freed ?
- If a cursored process put or modify a record is there a case that
another process read this record and obtain partial data, not the
entire data ?

I ask these question but I am unable to predict any deadlock in my
application. In this case it is impossible to choose between the simple
data store or to use the concurrent data store one.

Thank you


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.