dbTalk Databases Forums  

Concurrency control sequence

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


Discuss Concurrency control sequence in the comp.databases.berkeley-db forum.



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

Default Concurrency control sequence - 04-13-2007 , 12:54 PM






Hi guys! This my first question here.

My database need a concurrency control and I am using locks.
In tests I am using 100 Threads to insert anything in database. For
each insert I do:
-lock_id
-lock_get
-txn_begin
-db.put
-txn.commit
-lock_put

This sequence for each insert is correct?
To make checkpoint or syncs I need locks and transactions too?

I am using Python (Bindings for BerkeleyDB[1]), but I believe that
operation is not different in other languages.

[1] - http://pybsddb.sourceforge.net


Reply With Quote
  #2  
Old   
Florian Weimer
 
Posts: n/a

Default Re: Concurrency control sequence - 04-13-2007 , 02:29 PM






* Yoshio:

Quote:
Hi guys! This my first question here.

My database need a concurrency control and I am using locks.
In tests I am using 100 Threads to insert anything in database. For
each insert I do:
-lock_id
-lock_get
-txn_begin
-db.put
-txn.commit
-lock_put

This sequence for each insert is correct?
You don't need to use explicit locking when you use the transaction
data store. Just make sure that you set the DB_THREAD flag for the
environment and the databases when you use Berkeley DB from multiple
threads within the same process.

Quote:
To make checkpoint or syncs I need locks and transactions too?
You might need some lock to synchronize checkpoints, log archival and
log deletion, depending on your data durability requirements.


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

Default Re: Concurrency control sequence - 04-13-2007 , 10:56 PM



On 13 abr, 16:29, Florian Weimer <f... (AT) deneb (DOT) enyo.de> wrote:
Quote:
* Yoshio:

Hi guys! This my first question here.

My database need a concurrency control and I am using locks.
In tests I am using 100 Threads to insert anything in database. For
each insert I do:
-lock_id
-lock_get
-txn_begin
-db.put
-txn.commit
-lock_put

This sequence for each insert is correct?

You don't need to use explicit locking when you use the transaction
data store. Just make sure that you set the DB_THREAD flag for the
environment and the databases when you use Berkeley DB from multiple
threads within the same process.

To make checkpoint or syncs I need locks and transactions too?

You might need some lock to synchronize checkpoints, log archival and
log deletion, depending on your data durability requirements.
I will test the transactions without explicit locking.
Thank you for help.



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.