Merge branch 'dmytro-landiak-delete-relation'

This commit is contained in:
Igor Kulikov 2021-12-16 17:27:53 +02:00
commit 96853b034d

View File

@ -20,6 +20,7 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.ConcurrencyFailureException;
import org.springframework.data.domain.PageRequest;
import org.springframework.dao.DataAccessException;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.stereotype.Component;
import org.thingsboard.server.common.data.EntityType;
@ -161,7 +162,7 @@ public class JpaRelationDao extends JpaAbstractDaoListeningExecutorService imple
if (relationExistsBeforeDelete) {
try {
relationRepository.deleteById(key);
} catch (ConcurrencyFailureException e) {
} catch (DataAccessException e) {
log.debug("[{}] Concurrency exception while deleting relation", key, e);
}
}