FAIMS-521: adding database lock check for deleting arch entities and relationships