lock conflicts
541788Oct 25 2006 — edited Dec 10 2006I'm quite a newbie when it comes to using Berkeley DB. I am using BDB
dbxml.
I have an application that fetches data from an external source and
writes that into dbxml. The data fetch takes a long time, so I start a
new thread to do this. All writes into dbxml for that batch are then
done in that same new thread.
When I have a few batches running at the same time, after variable
amounts of time, the application will hang. When this happens my only
option is to run db_recover.
The problem happens when I have more than one of these: multiple writes
in multiple threads. I am protecting everything with transactions, but
am getting lock conflicts.
The output of db_stat -CA includes this:
1 Total number of locks not immediately available due to
conflicts
80000275 READ 28 HELD RefData page
3105
80000275 WRITE 55 HELD RefData page
3105
80000276 READ 1 WAIT RefData page
3105
Unfortunately, I don't know how to interpret this. How do I tell where
the conflict is happening? What sort of pattern should I be following
to prevent this from happening?
I don't know what information would help make the above clearer, but am happy to provide more.
Many thanks,
PC