Results 1 to 1 of 1

Thread: Spring Integration and Hibernate Lazy loading

  1. #1
    Join Date
    Dec 2011
    Posts
    13

    Default Spring Integration and Hibernate Lazy loading

    Hi all,
    There is my issue :

    I have an hibernate mapped object "Application" with sets of dependent objects "ApplicationImage", "ApplicationDescriptio",etc ...

    In spring integration, I have a defined gateway : DAOGateway with a method getAllApplications("") that gets the list of all the application in the database. To do that, this method calls an ApplicationDAO object which uses HibernateTemplate to load all the application objects from the database.

    I want to load only the application without it dependent sons ( ApplicationImage, ...). So i turned the attribute lazy="true.
    I also set the option show_sql in hibernate to see sql logs from hibernate.

    The proble is that when I Call ApplicationDAO directly : i have only the sql queries for loading the application tables and that's OK

    But when i use the DAOGateway to load the application, all the dependent tables are queried and that makes very big performance problems. I debugged and it seems the sql queries appears when the debuggger is in class :
    org.springframework.integration.handler.AbstractRe plyProducingMessageHandler
    Hope I was clear and thank your for your help.
    Last edited by Razink; Apr 26th, 2012 at 12:57 PM.

Posting Permissions

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