@big-bear
2016-02-02T10:45:37.000000Z
字数 383
阅读 1137
hibernate
down vote
The reason is that when you use lazy load, the session is closed.
There are two solutions.
Don't use lazy load.
Set lazy=false in XML or Set @OneToMany(fetch = FetchType.EAGER) In annotation.
Use lazy load.
Set lazy=true in XML or Set @OneToMany(fetch = FetchType.LAZY) In annotation.
and add OpenSessionInViewFilter filter in your web.xml
Detail See my post.
http://stackoverflow.com/a/27286187/1808417