Fixed database lock