Announcement Announcement Module
No announcement yet.
Lazy loading + Hibernate Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Lazy loading + Hibernate

    Hy all,

    I have a program which uses Hibernate with the DAOFactory pattern, every is ok until I use lazy loading in order to limits number select query. I also use struts for web layer.

    After web research, I visit Karl Baum's Weblog

    I try to use solution 1 using OpenSessionInViewFilter, but I have null pointer exception when I use "getHibernateTemplate()". It may be due to problems beetwen hibernateTemplate and sessionFactory.

    If I use OpenSessionInViewFilter, I don't know if I must use applicationContext.xml or if configuration in web.xml is enough. If someone can explain me the solution for using lazy loading with Hibernate.....
    Perhaps problem come with my use of struts

    Thank you for your help...


  • #2
    Take a look at AppFuse: It contains several web and persistence frameworks along with Spring.


    • #3
      Perhaps problem come with my use of struts
      See Mark Eagle's Wiring Your Web Application

      The picture at the end is helpful ... your NPE makes it sound like you haven't done one piece of the connection.