If your DB doesn't have locking capability, use a locking module. When you need to update a db; create a new one. Lock the new db. When the new db is finished writing to the disk, unlock it and replace the old db with the new db. That way, the old db is safe while the update is being made to the new db.
I hope that helps,