ECMS-4816: ConstraintViolationException when delete a document template