failed to lazily initialize a collection of role
Entity操作でこんなエラーになったよ。
failed to lazily initialize a collection of role: jp.*****, no session or session was closed
FetchTypeが悪かったみたいだよ。
こうしたよ。
@OneToMany(fetch = FetchType.EAGER)
そしたら次はこうなったよ・・・
org.hibernate.HibernateException: cannot simultaneously fetch multiple bags
http://www.grandnature.net/blog/archives/cat7/
ここに解決方法が載ってたよ。
FetchType.EAGERを複数指定すると例外が発生するらしいよ。
設定してないんだけどなぁ・・・。
@OneToMany(fetch = FetchType.EAGER) @Fetch(FetchMode.SUBSELECT)
こうすればいいらしいよ。