Exception
[Waring] Explicitly configure spring.jpa.open-in-view to disable this warning
헤르메스의날개
2023. 2. 26. 00:40
728x90
개발환경 :
Spring Boot 2.7.9
Database : H2-2.1.214
JDK : 11.0.18 x64
JPA
WARN 23-02-26 00:34:198[restartedMain] org.springframework.boot.autoconfigure.orm.jpa.JpaBaseConfiguration$JpaWebConfiguration.openEntityManagerInViewInterceptor[223]: - 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 Message 처리
spring:
jpa:
open-in-view: false
database-platform: org.hibernate.dialect.H2Dialect
hibernate:
ddl-auto: update
properties:
hibernate:
dialect: org.hibernate.dialect.H2Dialect
format_sql: true
show-sql: true
open-in-view: false 설정 해결
Spring Boot에서는 spring.jpa.open-in-view를 true로 설정하고 있는데, 이는 OSIV 측면에서 매우 부적절하다고 함. 즉 성능이나 scalability,, 즉 확장성 측면에서 볼 때 false로 해야 하는데 true로 하고 있어 warning 경고 사인이 뜨는 거라고.
출처 : https://mand2.github.io/spring/spring-boot/1/
728x90