Results 1 to 3 of 3

Thread: Lazy loading + Hibernate

  1. #1
    Join Date
    Mar 2005
    Posts
    1

    Default 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. #2
    Join Date
    Jan 2005
    Location
    Bucharest, Romania
    Posts
    5,403

    Default

    Take a look at AppFuse: http://raibledesigns.com/wiki/Wiki.jsp?page=AppFuse. It contains several web and persistence frameworks along with Spring.
    Costin Leau
    SpringSource - http://www.SpringSource.com- Spring Training, Consulting, and Support - "From the Source"
    http://twitter.com/costinl
    Please use [ c o d e ] [ / c o d e ] tags

  3. #3
    Join Date
    Feb 2005
    Posts
    217

    Default

    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.

Similar Threads

  1. Replies: 2
    Last Post: Dec 8th, 2005, 09:00 AM
  2. how to use hibernate lazy loading with spring transaction
    By tanmoy.chakraborty in forum Data
    Replies: 1
    Last Post: Oct 11th, 2005, 02:07 AM
  3. Hibernate and Lazy Loading.
    By cmrudd in forum Data
    Replies: 1
    Last Post: Oct 3rd, 2005, 03:58 AM
  4. Replies: 4
    Last Post: Jun 20th, 2005, 10:52 AM
  5. Replies: 4
    Last Post: Jun 16th, 2005, 09:48 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •