2 Replies Latest reply on Sep 17, 2006 6:02 PM by pmuir

    Stateful Session Bean Instances and Conversations

    jgilbert

      I have a SFSB involved in a conversation that manages an instance of an entity bean. and the user can have multiple conversations. when i switch between conversations the state seems to be the state of the last used conversation. Is an instance of the SFSB created for each conversation? I would think the answer is no. If no, does it make sense to use a SFSB? Or should I just use bijection to store the entity bean in the conversation?

        • 1. Re: Stateful Session Bean Instances and Conversations
          bfo81

           

          @Stateful
          @Scope(ScopeType.CONVERSATION) //I think this is the default scope so you might leave it out
          @Name("...")
          public class WhateverBean implements Whatever, Serializable {
          
           @In(required=false) //should be initially created in here
           @Out
           private AnEntity entity;
          
          ...
          }


          If you do it like this, there should be a separate SFSB for every conversation and every instance has its very own entity instance.

          • 2. Re: Stateful Session Bean Instances and Conversations
            pmuir

            It depends on you conversation propogation. You can control this using the s:link tag or the conversationPropogation request parameter. Unless you @End a conversation or set the conversationPropogation to none you remain in the current conversation.