I still suggest you just swap direct DB_File for MLDBM::Sync. What you have seems like a locking issue, but without looking at the rest of your code, it's very hard to find it. You should keep in mind that not all of the data you write to DB_File will go to disk until you untie it, and that can sometimes confuse people. MLDBM::Sync takes care of all that for you.