2 Replies Latest reply on Jul 13, 2005 9:56 PM by doofus

    OneToMany FetchType ignored

      beta1 always eager loads collections, even when annotated with FetchType.LAZY.

      I have the following test, which passed in Preview5 but fails in Beta1:

      try { foo.getLazyItems().size(); fail(); }
      catch (LazyInitializationException e) {assertTrue(true);}
      


      This is similar to http://jira.jboss.org/jira/browse/EJBTHREE-134, but includes the OneToMany tag now.

      Darin

        • 1. Re: OneToMany FetchType ignored
          elmosca2

          I am also experiencing this issue, but only when I use some kind of cascades with the method. When there is a cascade, the collection is fetched with EARLY... That did not happen in Preview5...

          Regards,

          B.

          • 2. Re: OneToMany FetchType ignored
            doofus

            I've got the same issues. I've logged a JIRA bug report.
            http://jira.jboss.com/jira/browse/EJBTHREE-215

            I am using a foreign key mapping strategy and there is no join table involved. In addition, I have set up my entities such that there IS a bidirectional relationship between, for example:

            Entity A and Entity B

            - Entity A has a one-to-many to Entity B
            - Entity B has a many-to-one relationship to Entity A

            -luke