IT정보/Error

Connection is read-only. Queries leading to data modification are not allowed 에러 해결

멋쟁휘개발자 2024. 5. 23. 17:01

에러 메세지

Connection is read-only. Queries leading to data modification are not allowed

 

원인

Service 전체에 @Transactional(readOnly = true) 를 붙여주어 read 권한만 허용한 상황

해결

필요한 메서드에 @Transactional 를 붙이거나,

readOnly가 없는 클래스로 이동시키면 됨