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

  • 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, 01:57 PM.
Working...
X