1 Reply Latest reply on Dec 3, 2007 6:46 AM by Gerhard Balthasar

    unable to lazy load objects

    Vincent LAUGIER Newbie

      Hello,

      we have a performance problem caused by an eager load of the objects

      we have put the annotations in this way :

      @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "manager")
       public List<Employee> getEmployees() {
      
      ...
      


      but we cannot make lazy loading work

      I have read some things about ejb3/hibernate limitations, contexts, and something in this blog (http://pilhuhn.blogspot.com/2006/08/how-to-outsmart-lazy-loading.html)

      but I have not found them helpful for the moment

      does anyone has met this behavious before ?

      thanks

      vincent


        • 1. Re: unable to lazy load objects
          Gerhard Balthasar Newbie

          afaik n to many relations are recognized as lazy by hibernite and that should work out of the boy. For using lazy loading with lazy properties you need byte level instrumentaion by hibernate for your Entitybeans. You may give this a try (see hibernate docs for an ant task). Chance is good that all relations will work lazy afterwards.

          Greetz GHad