2 Replies Latest reply on Mar 12, 2009 11:18 PM by chopin

    Long-Running Conversations without Persitence @End

    chopin

      I am using a long-running conversation to edit a bean. The long-running conversation can be leaved by eather pressing a Save or a Cancel button. Both buttons are calling methods of the action bean, but only the Save method is performing a merge operation on the extended entity manager.


      Issue: It does not matter which button I am pressing, the bean will be merged anyway.


      I tried different approaches for managing transactions in the hope to solve the issue, but I did not change the behaviour of my application.


      What is required to not persist beans, if the Cancel button is pressed to end the long-running conversation?


      Your help is greatly appreciated. Thank you very much!

        • 1. Re: Long-Running Conversations without Persitence @End
          swd847

          Are you using the seam managed persistence context? If so did you start the conversation with FlushMode.MANUAL?


          Why do the entities need to be merged? If you are using a conversation scoped SMPC then the entities should already be contained in the entityManager and will be automatically flushed after every request (and most entityManager operations), which is probably causing the behaviour you are seeing.

          • 2. Re: Long-Running Conversations without Persitence @End
            chopin

            You spotted my mistake. I accidentally did not use an SMPC. After changing the application, I see now the behaviour I am expecting.


            Thank you very much!