Results 1 to 7 of 7

Thread: <persistence-context> - Subflow - LazyInitializationException

  1. #1
    Join Date
    Mar 2008
    Posts
    170

    Default <persistence-context> - Subflow - LazyInitializationException

    Hi all,

    I use the <persistence-context> element in a flow definition which calls a subflow. The subflow does either change or create an object. After the subflow is ended and the control is again in the flow definition with <persistence-context> I get
    Code:
    org.hibernate.LazyInitializationException - could not initialize proxy - no Session
    while continuing on the flow.

    The session should not be closed due to calling a subflow after returning?
    In case the session should still be active what can cause the termination?

    Thanks for any suggestions.

    - Peter

  2. #2
    Join Date
    Aug 2004
    Location
    Melbourne, FL
    Posts
    2,794

    Default

    Peter,

    The session should not be closed after a subflow returns to a parent marked <persistence-context>. Are you using the Hibernate listener or the JPA one? Which version of SWF?

    Keith
    Keith Donald
    Core Spring Development Team

  3. #3
    Join Date
    Mar 2008
    Posts
    170

    Default

    Thx for the quick reply Keith.

    I'm using org.springframework.webflow.persistence.HibernateF lowExecutionListener
    and
    SWF 2.0.2.CI-499

    - Peter

  4. #4
    Join Date
    Oct 2006
    Posts
    16

    Default

    Hi
    I think I have the same problem as iwtolall.
    I have a flow with the <persistence-context> element and this flow call a subflow. This subflow output a list of hibernate objets and when the main flow try to access to them, I obtain an exception :
    Code:
    org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role : my.package.MyObject.myProperties, no session or session was closed
    I'm using org.springframework.webflow.persistence.HibernateF lowExecutionListener and SWF 2.0.3.

    How can I solve this problem ? Is it a bug ?
    Thomas

  5. #5

    Default

    Hello, same problem on 2.0.5, any fix on the roadmap ?

  6. #6
    Join Date
    Oct 2006
    Posts
    16

    Default

    I found this issue in the jira : SWF-360.

  7. #7
    Join Date
    Mar 2009
    Location
    Ajaccio, France
    Posts
    25

    Default

    Just to let you know that I submitted to SWF-360 a version of the JpaFlowExecutionListener that propagates the persistence context to the subflow. Any feedback is welcome.

    Nicolas.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •