Once you have locking initialized in your BerkeleyDB environment (which it sounds like you do), you can mostly forget about it. BerkeleyDB will automatically acquire and release locks as needed. You only need to give the DB_WRITECURSOR flag if you really want to use a cursor to write to the database. If you do all your writes with db_put or tied hash assignments, you don't need to worry about it.