10 Replies Latest reply on Apr 21, 2009 9:36 PM by Brandon Simpson

    Ending conversation but objects still remain in conversation scope

    Vassiliy Dubkin Newbie

      I have a problem ending a conversation. I have a dataTable, there is a link for each column. If a user clicks on a link the current object will be put into conversation scope, a long running conversation will be started and the user will be forwarded (no redirect) to a new page. Additional objects and collections will be put in the conversation on the detail pages.


      Here's the problem: When the user goes back to the overview page (which contains the dataTable) and clicks the above mentioned link for another row, the current conversation must be ended (if one exists) and a new one needs to be started. I am using the following code snipped in the action method for that link but the code does not work as expected. The old objects and collections still remain in the same conversation. Here's the code:


      if (Conversation.instance().isLongRunning()) {
        Conversation.instance().end();
        Conversation.instance().begin(false, false);
      } else {
        Conversation.instance().begin();
      }



      I created a test case where I called the end() method in a separate request, the conversation will be destroyed and all objects were removed. Why does that not work for one request? What is wrong with my understanding / code? Have I forgot something?


      Thanks in advance!