org.springframework.dao.InvalidDataAccessApiUsageException: 오류

강낭콩·2023년 7월 5일

board를 삭제하면서 reply도 같이 삭제하려고 하다가 테스트를 해볼까 해서 실행 했는데 오류가 발생했다.

org.springframework.dao.InvalidDataAccessApiUsageException: No EntityManager with actual transaction available for current thread - cannot reliably process 'remove' call; nested exception is javax.persistence.TransactionRequiredException: No EntityManager with actual transaction available for current thread - cannot reliably process 'remove' call

해결 : @Test에서 삭제할 때는 중요한 작업이기 때문에 @ Transactional을 적용시켜줘야 한다.

0개의 댓글