in reply to Locking a SDBM_File

You're not supposed to place a lock on a data resource directly. Use a semaphore file instead.