Discussion:
Concurrency control sequence
(too old to reply)
Yoshio
2007-04-13 17:54:49 UTC
Permalink
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
Florian Weimer
2007-04-13 19:29:07 UTC
Permalink
Post by 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
-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.
Post by Yoshio
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.
Yoshio
2007-04-14 03:56:24 UTC
Permalink
Post by Florian Weimer
Post by 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
-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.
Post by Yoshio
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.

Loading...