[spring] 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
JPA 프로젝트를 빌드하는데 다음과 같은 에러가 나오고 화면이 나오지 않았다.
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
이러한 오류가 생기는 것은 Spring Boot에서는 spring.jpa.open-in-view를 true로 설정하고 있는데
OSIV(Open Session In View) 측면에서 매우 부적절하다고 한다.
즉 성능이나 확장성 측면에서 볼 때 false로 해야 하는데 true로 하고 있어 warning 경고 사인이 뜨는 거라고 한다.
application.properties 에서 spring.jpa.open-in-view를 true 에서 false로 바꿔주면 해결된다.
spring.jpa.open-in-view=false
자세한 내용은 아래 링크를 참고하면 된다.
What is this spring.jpa.open-in-view=true property in Spring Boot?
I saw spring.jpa.open-in-view=true property in Spring Boot documentation for JPA configuration. Is the true default value for this property if it's not provided at all?; What does this really do? ...
stackoverflow.com