This week's book giveaway is in the OCAJP forum.
We're giving away four copies of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) and have Khalid A Mughal & Rolf W Rasmussen on-line!
See this thread for details.
Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

using c:forEach with spring/hibernate lazy loading

 
Dave Brown
Ranch Hand
Posts: 301
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

Hoping someone can point out the error of my ways..

My very basic scenario is this..
1. Show login page
2. User(Agency) logs in
3. I set the Agency object in the session and forward to a menu page...
4. User clicks a link.
5. I show a jsp with a forEach tag which displays elements from a List collection belonging to the Agency object in the session.

at point 5 however I get a Hibernate LazyInitializationException (no session or closed session)

I have spring setup, with an openSessionInView filter.. which when I changed log4j to display Debug info showed me it is definately opening a session prior to processing the jsp page. Here is a snippet from server output..


as you can see the collection i'm trying to go over is sellers.. which belongs to my Agency object...

I've been scanning google and going over what I found for most the afternoon so any help pointers are greatly appreciated.

Thanks
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65118
89
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's a Hibernat issue, not a JSP one. Moved to the ORM forum.
 
Pascal Steiner
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
http://www.hibernate.org/43.html

hope, this can help you

regards

pascal
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic