[Debtags-devel] Re: Recent progress

Erich Schubert Erich Schubert <erich.schubert@gmail.com>
Tue, 15 Feb 2005 00:28:42 -0800


Hi,
One more status update:
Parsing of the tags-current file into a BerkeleyDB is also done,
except for one thing:
locking.

This sucks. I'm quite annoyed by now - whatever I try to have libdb
lock the data sets, it either brings import performance down to a
crawl, crashes, or gives me some unreadable error messages...

I have a classic read-modify-write cycle; if I don't want to lose
data, i need to make the read lock the entry from writing, then
eventually do my write, commit and unlock.
How do I do this in BerkeleyDB without re-opening the database all the time=
?
The only way to do this I have found yet is:
- make a new transaction
- open database
- do read operation with DB_RMW flag
- do write
- commit transaction

But I can only open a database within a transaction, not the other way
round. :-(

Greetings,
Erich Schubert
--
    erich@(mucl.de|debian.org)      --      GPG Key ID: 4B3A135C    (o_
  To understand recursion you first need to understand recursion.   //\
  Wo befreundete Wege zusammenlaufen, da sieht die ganze Welt f=FCr   V_/_
        eine Stunde wie eine Heimat aus. --- Herrmann Hesse