3 Replies Latest reply on Oct 18, 2013 10:23 AM by javacoryd

    Nested conversation StaleStateException

    derkd

      Hi all,


      I get a staleStateException when restoring the parent conversation. When I start the parent conversation I inject the customerHome into the CustomerAction which is in conversation scope. I have a page where I have a table with customers. When I click on the add button to add a project to a customer (customer-->project OneToMany) I go to the project.xhtml and a nested conversation begins where I inject the customerHome again in the ProjectAction which is also in conversation scope. I save the project by calling saveProject() where I attach the project entity to the customer entity which has cascade all.  Then I call


      customerHome.update()



      In the page action I call



      <navigation from-action="#{projectAction.saveProject}">
                <rule if-outcome="saveProject">
                     <end-conversation before-redirect="true"/>
                     <redirect view-id="/customer/index.xhtml"/>
                </rule>
           </navigation>



      The customer entity is updated but when the parent conversation is restored I get a StaleStateException: current database version number does not match passivated version. Apparantly the parent conversation has a reference to an old version of the customer entity.
      How can I get this fixed?

        • 1. Re: Nested conversation StaleStateException
          javacoryd

          Has anyone solved this issue?  We are getting this same issue with the upgrade to Seam 2.3.0 Final

          • 2. Re: Nested conversation StaleStateException
            tremes

            This looks like a bug. Can you provide any reproducer by a chance? I assume that's same also for 2.3.1.Final....Did you try this?

            • 3. Re: Nested conversation StaleStateException
              javacoryd

              I didn't try Seam 2.3.1 Final.  We are at the end of a long upgrade from JBoss 4/Seam 2.1.1 to JBoss 7.1.1/Seam 2.3.0.

               

              I did find somewhat of a workaround that is working for us.  So in the action class that is mapped to the nested conversation, if I explicitly do an @In on the entity that ends up getting the StaleStateException the error goes away.  I assume this brings the entity explicitly into the nested conversation.  This allows us to get by this issue.

               

              Cory.