3 Replies Latest reply on Aug 29, 2007 3:28 PM by Waseem Quraishi

    New LazyInitializationException from beta1 to CR2

    ryan dewell Novice

      Upgrading from beta1 to CR2. Continuing to use SeamExtendedManagedPhaseListener as always. I have a Session scoped component that holds an entity reference. However, I'm now receiving a LazyInitializationException when accessing that entity on the "next" request:

      org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: com.x.site.SiteOwner.siteList, no session or session was closed
       at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationException(AbstractPersistentCollection.java:358)
       at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationExceptionIfNotConnected(AbstractPersistentCollection.java:350)
       at org.hibernate.collection.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:343)
       at org.hibernate.collection.AbstractPersistentCollection.read(AbstractPersistentCollection.java:86)
       at org.hibernate.collection.PersistentBag.iterator(PersistentBag.java:246)
       at com.sun.facelets.tag.jstl.core.ForEachHandler.toIterator(ForEachHandler.java:254)
      


      I never received LazyInitializationException's in beta 1 and am wondering what I might need to change to avoid them again.

      Thanks,

      Ryan