• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Problem with Lazy loading of hierarchical data with spring

 
Greenhorn
Posts: 8
Hibernate Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

we are facing with lazy loading in spring framework, we don't know where we are doing silly mistake. Code of all the layer are as below, please suggest what should we do. When we access siteManager object from siteManagerSite in service layer, we get some value but the same thing is not retrieved in controller class, throwing LazyInitializationException. If we access siteManger obejct in Dao/service class or put Hibernate.initialize(sms.getSiteManager()) code either in service or dao layer then we are able to get siteManager object in controller, I think puting this code in service or dao layer is not the solution of loading lazily. there is no SiteManager.hbm.xml in our application, its mapped as below by joined-subclass in related object. Please help me, how to retrieve/load the siteManager in controller class.

 
Bartender
Posts: 2856
10
Firefox Browser Fedora Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"jr kr " please check your private messages for an important administrative matter. You can check them by clicking the My Private Messages link above.
 
reply
    Bookmark Topic Watch Topic
  • New Topic