spring.jpa.open-in-view
springbootのアプリケーション作成中、毎回起動時に警告が発生していた。
警告内容:
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.jpa.open-in-view」がデフォルト設定になっていることのよう。
「spring.jpa.open-in-view」とは?
以下のサイトがとても分かりやすくまとめてくれているので大変参考になった。
参考サイト:
Open Session in Viewは使用すべきなのか?
対応方法:
結局警告出ないようにするにはどうするのか。
対応方法は以下の参考サイトに記載されたプロパティの設定を記載して、デフォルト(有効)設定から、手動で無効設定に変更する。
参考サイト:
java - Spring Bootのこのspring.jpa.open-in-view = trueプロパティとは何ですか?
設定記載例:
spring.jpa.open-in-view=false