Berkeley DBXML and thread deadlock

For my XCAPServer project, I use Berkeley DB XML for XML document repository. I am kind of stuck due to all threads goes into deadlock while adding and removing documents.

See more information on dbxml forum at: DBXML 2.4.16: Accessing containers from multiple threads and deadlock

Solution: To avoid the deadlock, call set_lk_detect(DB_LOCK_MINWRITE) on DbEnv variable. Also make sure when exceptions are thrown, transactions must be either aborted or committed.

Here is a link to the source code: dbxml_db.cpp

No comments: