13 Replies Latest reply on Oct 30, 2006 12:11 PM by vikasphonsa

    Tryed searching for this issue, but haven't found anything.

    orclev

      Ok, I've got a entity bean with a property annotated like so:
      @JoinColumn(name="background", nullable=false)
      @ManyToOne(cascade={CascadeType.PERSIST}, fetch=FetchType.EAGER)
      @LazyToOne(LazyToOneOption.FALSE)
      public Background getBackground() {
      return background;
      }

      Which if I'm reading everything properly should cause the Background object to be initialized when the entity bean is loaded from the DB, however I keep getting a LazyInitiaalizationException when I attempt to access that method saying that the owning session was closed.
      Why is it trying to load the background lazily when I specificly listed it as non-lazy and eager?