springboot

JAVA/오류해결

[Spring Boot][오류해결] Executing an update/delete query

스프링 부트를 사용할 때 네이티브 쿼리를 통해 JPARepository를 다루는 경우가 있다. 그런데 아래와 같은 오류가 발생할 때가 있다. Resolved [org.springframework.dao.InvalidDataAccessApiUsageException: Executing an update/delete query; nested exception is javax.persistence.TransactionRequiredException: Executing an update/delete query] TransactionRequiredException이 발생한 것인데, update/delete 쿼리를 실행할 때 @Transactional을 붙여주지 않았기 때문에 발생한 에러이다. 문제의 코드 publ..

gakko
'springboot' 태그의 글 목록