Announcement Announcement Module
Collapse
No announcement yet.
Lazy loading + Hibernate Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • 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 http://www.jroller.com/page/kbaum/20...ation_with_dao

    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...

    Ben....

  • #2
    Take a look at AppFuse: http://raibledesigns.com/wiki/Wiki.jsp?page=AppFuse. It contains several web and persistence frameworks along with Spring.

    Comment


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

      http://www.onjava.com/pub/a/onjava/2...ngwebapps.html

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

      Comment

      Working...
      X