3 Replies Latest reply on Aug 13, 2009 6:15 AM by Andrew Martin

    dought regarding @conversation behaviour

    ashutosh deora Newbie

      i am using seam 2.1


      i have declared a session bean as
      @Stateless
      @Scope(ScopeType.CONVERSATION)


      i want to know what type of behavior it will show and why


      will it will behave like a @Stateful
      if yes
      then what is the use of declaring a session bean as @Stateful
      while running JBOSS server it wrapped the Stateless with Stateful
      please tell me the reason and logic
      if any one can

        • 1. Re: dought regarding @conversation behaviour
          Arbi Sookazian Master

          Don't use @Stateless @Scope(ScopeType.CONVERSATION) combo.


          SLSBs live in a pool in the ejb container.  That means the client may get a different instance of the SLSB on subsequent method invocations.  SLSBs are used for services (like a credit check component) and SFSBs are used for maintaining state in a conversation (like a multi-page wizard).


          Use JavaBean or SFSB with @Scope(ScopeType.CONVERSATION).

          • 2. Re: dought regarding @conversation behaviour
            ashutosh deora Newbie

            i am fully agree whatever you have said
            but my question is why this combination is working
            what is the logic behind this
            i know that where is SLSB and SFSB are used
            what i want to know is what type of behavior it will show if i use this combination
            if it should be the combination then why it is not giving any error


            i want to know the theory behind this behavior
            please tell me that if you can
            thanks for the reply

            • 3. Re: dought regarding @conversation behaviour
              Andrew Martin Newbie

              1) Well we surely shouldn't put SLSB in Conversation context but why doesn't it give any compiler or atleast Server error while deploying!


              2) SFSB can not be used in Stateless and Page context. I wonder why it is not alowed to be used in page context while it is allowed in Lower scope of event context!