After some pondering about why the database might be locked so frequently, this is what I've managed to come up with. The first patch is the most likely to actually help with that, and the others mostly involve improving robustness. Ideally we'd come up with a test to quantify how much these kinds of changes affect contention over the database. For now, though, all that I can think of is seeing how this affects the systems that have had issues with that. - reepca