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

    Nested conversation StaleStateException

    Derk Dukker Novice

      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


      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"/>

      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?