2 Replies Latest reply on Sep 7, 2011 7:48 PM by zlatko99.zlatko.suslevski.gmail.com

    Conversation id not incremented by 1

    zlatko99.zlatko.suslevski.gmail.com

      When I use my own-developed Seam 2.2 web application, I have noticed that, on every consequent link or button click, the conversation id is incremented by a random large number. For example, it starts with a single-digit number, and after a few clicks here and there, the conversation id grows up to 558 or more. Is this the default conversation id generator strategy to not lineary increment the cid number, or am I doing something wrong in my app (maybe, some implicit redirects that eat up cid numbers)?


      Thank you in advance,
      Zlatko

        • 1. Re: Conversation id not incremented by 1
          nathandennis

          i think there is a serious problem with your conversation management...


          ill give you a bit of constructive code to add to your project and watch your conversations



          package com.denniscg.action;
          
          import javax.ejb.Stateless;
          
          import org.jboss.seam.annotations.In;
          import org.jboss.seam.annotations.Logger;
          import org.jboss.seam.annotations.Name;
          import org.jboss.seam.annotations.Observer;
          import org.jboss.seam.contexts.Context;
          import org.jboss.seam.core.Conversation;
          import org.jboss.seam.log.Log;
          
          @Stateless
          @Name("conversationListener")
          public class ConversationListenerBean implements ConversationListener {
          
               @Logger
               private Log log;
          
               
               @Observer(value="org.jboss.seam.endConversation")
               public void observeConversationEnd() {
                    log.info("CONVERSATION Ended");
                    
               }
          
               @Observer(value="org.jboss.seam.beginConversation")
               public void observeConversationStart() {
                    log.info("CONVERSATION Started");
                    
                    
          
               }
          
               
          }
          
          package com.denniscg.action;
          
          public interface ConversationListener {
          
               void observeConversationStart();
               void observeConversationEnd();
          }
          
          



          need to keep track of your conversations. and depending on what you are doing, end one before starting another. cant just create a bunch of transaction without managing them correctly or you are going to see serious lag on your server. unless told to retain the parent conversation,, each ajax command gets its own. figured this out when working with Seam Remoting. i think there is a couple pages written about it on this forum a few years ago.

          • 2. Re: Conversation id not incremented by 1
            zlatko99.zlatko.suslevski.gmail.com

            Nathan,


            Thank you very much for your response. I will try your recommendation with the provided code and report the results.


            However, I do not start explicit conversations, nor do I mark explicit transactions. But, my app is full of ajax requests. So, will further investigate this problem regarding ajax calls.