1 Reply Latest reply on Oct 4, 2007 9:47 AM by Jacob Orshalick

    Identifying long running conversations

    omilian Newbie

      I'm having a few difficulties understanding the observed behaviour of my conversations.

      I have an application which starts 2 conversations one after the other. Both conversations are defined on stateful EJBs with methods annotated with @Begin. Both of these 'begin' methods are called, so at this point I expect I'll have a long running conversation, but I don't see the 'clr' in the URL that I would expect (having set conversation-is-long-running-parameter="clr" in components.xml). I do see the conversation in the debug.seam page, but I can't tell from this listing if the conversation is long running or not (can I?).

      To get a bit more info I did the following 2 things:

      1- I've added a "conversationLogger" event listener as follows.

      @Name("conversationLogger")
      public class ConversationLogger implements Serializable {
      
       private Log log = Logging.getLog(ConversationLogger.class);
      
       @Observer("org.jboss.seam.beginConversation")
       public void logConversationBegin() {
       Conversation currentConversation = Conversation.instance();
       log.info("Beginning conversation: #0, Parent Id: #1", currentConversation.getId(), currentConversation
       .getParentId());
       }
      
       @Observer("org.jboss.seam.endConversation")
       public void logConversationEnd() {
       Conversation currentConversation = Conversation.instance();
       log.info("Ending conversation: #0, Parent Id: #1", currentConversation.getId(), currentConversation
       .getParentId());
       }
      }


      2 - In my pages I've included the following line in my facelets:

      Current converstation is long running #{org.jboss.seam.core.conversation.longRunning}


      Curiously, I don't see any event being raised by the 'conversationLogger', nor do I see the 'clr' in the URL, however my pages do display "Current conversation is long running true". Do I have a long running conversation or not? Why might the methods marked with @Begin not raise the 'org.jboss.seam.beginConversation' event?

        • 1. Re: Identifying long running conversations
          Jacob Orshalick Apprentice

          When you say,

          "omilian3" wrote:
          ... Both of these 'begin' methods are called, so at this point I expect I'll have a long running conversation...


          I am assuming you are saying that the methods are called on different actions, not from the same action, correct? You shouldn't be calling more than one method with an @Begin during an action. Please post the related code and it will be easier to see what might be going on.