private void saveInvitationCodes(List<InvitationCodeDTO> dtoList) { if (CollectionUtil.isEmpty(dtoList)) return; NotificationWriter writer = notificationDaoManager.getWriter(); Object status = writer.begin(); InvitationCode code; try { for (InvitationCodeDTO dto : dtoList) { code = new InvitationCode(); writer.save(code.fromDto(dto)); } writer.commit(status); } finally { writer.rollback(status); } }