Florian Weimer wrote:
Quote:
* Petra Chong:
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.
Do you run any kind of deadlock detector? |
I do- but it didn't help.
However, I have solved the problem like this:
(I am using dbxml)
1. All queries use XmlQueryContext.DeadValues except where live values
are truly necessary. This reduced the read-write lock conflicts
considerably
2. All queries specify DB_RMW if they are selecting nodes to be
modified later (read-modify-write pattern)
This got me to the point where I was getting write-write lock
conflicts. This was easy to solve by:
3. Making all writes in my application single-threaded. I realise that
this solution is probably not acceptable for other applications, but my
usage pattern is such that single-threaded writes are acceptable.
Basically I am running a series of batch uploads where the source data
comes from an external source that takes a long time to return. The
data is only useful to me after it has completed uploading; it doesn't
matter whether 5 batches run sequentially or are interleaved- I only
care about when they are all uploaded completely.
Regards
PC