2 Replies Latest reply on Apr 25, 2013 8:30 AM by omid pourhadi

    why an entity bean can fail to be put in the context?

    Dmitry Pustovoit Newbie

      I set a user bean in one stateful bean and then navigate to a different page and in the init method for the page I can see that the entity bean is initialized by seam again and my data is lost, but this is just an assumption:

       

      so I have

       

      @Stateful

      @Name("someBean")

      @Scope(ScopeType.CONVERSATION)

      @MeasureCalls

      public class someBeanimplements someBeanLocal, Serializable {

       

          @In(required = false)

          @Out(required = false)

          private Thing thing;

       

      public String quickOpenidLogin() {

       

                  userService = (UserServiceLocal) Component.getInstance("userService");

                 this.thing = userService.getThisThing();

       

              return RESULT_SUCCESS;

       

       

          }

       

      }

       

      then I go to the next page

       

      <page view-id="/successPage.xhtml" no-conversation-view-id="/home.xhtml"

                concurrent-request-timeout="60000"

                conversation-required="true"

                login-required="true">

        <action execute="#{secondBean.initializeSecond}" on-postback="false"/>

       

          </page>

       

      when method initializeSecond is called in secondBean:

       

      @Stateful

      @Name("secondBean")

      @Scope(ScopeType.CONVERSATION)

      @MeasureCalls

      public class SecondBean extends AbstractCommonSecurity implements SecondBeanLocal {

          


      @In(required=false)

      @Out(required=false)

      protected Thing thing;

       

       

      public void initializeSecond() {

           user.getId() is empty

      }

      }