본문 바로가기
Today I Learned/Daily Log

[DaliyLog] JpaBaseConfiguration$JpaWebConfiguration : spring.jpa.open-in-view is enabled by default. Therefore, database queries may be performed during view rendering. Explicitly configure spring.jpa.open-in-view to disable this warning

by 프로그래 밍구 2024. 2. 5.

상황

새 프로젝트를 진행하면서 Jpa와 MySQL을 연동하는 중 다음과 같은 경고가 떴다.

 

WARN 8604 --- [           main] JpaBaseConfiguration$JpaWebConfiguration : spring.jpa.open-in-view is enabled by default. Therefore, database queries may be performed during view rendering. Explicitly configure spring.jpa.open-in-view to disable this warning

 


해결

 SpringBoot는 기본적으로 spring.jpa.open-in-view이 true로 설정되어 있고, 랜더링 중에 database 쿼리가 실행될 수 있다고 한다. 그러므로 application.yml 파일에서 false로 바꿔주는 것이 좋다.

 

jpa:
  open-in-view: false

 

 

댓글