dbTalk Databases Forums  

Lock lifetime

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


Discuss Lock lifetime in the comp.databases.berkeley-db forum.



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

Default Lock lifetime - 02-07-2006 , 02:23 AM






hello all,

in the "Berkeley DB transaction processing with c++" reference it is
said that:
"A transaction holds any locks that it obtains until the transaction is
commited or aborted"
(Lock Lifetime, pg.31)

it is also said that:
"In Addition, for cursors you can use read uncommitted isolation, which
causes the cursor
to release its read locks as soon as it is done reading the record (as
opposed to holding
its read locks until the cursor is closed" (Avoiding Blocks, pg. 33)

what about transactional cursors?
when i use a transactional cursor with READ COMMITTED isolation, is the
lock held until the transaction is committed or until the cursor has
finished its current read operation (moved to the next record)?

in addition, i find it pretty hard to debug my application in order to
see how deadlocks occur.
is there any utility that I can use to see all the locks that are held
on the database?

thank you very much.
moshe levi.


Reply With Quote
  #2  
Old   
ubell@sleepycat.com
 
Posts: n/a

Default Re: Lock lifetime - 02-08-2006 , 09:45 AM






Moshe,

DB_READCOMMITTED locking releases locks as soon as possible. That is
as soon as the cursor leaves the page.

You can use the -C flag to db_stat to see what locks are held. Please
see:
http://www.sleepycat.com/docs/utility/db_stat.html

Michael Ubell
Sleepycat Software


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.