• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to fetch lazily loaded entities?

 
nitin pai
Ranch Hand
Posts: 185
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a entity Dept within Employee entity. The Dept entity is set to lazy loading.

Any idea on how to do a emp.getDept() in the web tier when the DAO has long closed the session after the Employee was fetched?

Update: I am using Hibernate3 with Spring 2.0
[ November 25, 2008: Message edited by: nitin pai ]
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It sounds like the Session per request pattern is what you are after. Have a read of this.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic