FAIMS-238: fixed bug where locked was checked when only reading from the database