1 Reply Latest reply on Jan 19, 2004 4:42 AM by Darran Lofthouse

    How to find stateful session bean between calls?

    twgerber Newbie

      I know this is a dumb question.

      I have a servlet that creates a stateful session bean

      Context ctx = getInitialContext();
      TraderHome brokerage = (TraderHome) ctx.lookup("statefulSession.TraderHome");

      // Give this trader a name
      Trader trader = brokerage.create("Terry");

      Once the sfsb does its thing the servlet returns some data. A subsequent call gets made to a different servlet (for the same logical person).

      How can this second servlet instance find the previously created sfsb?

      Does it do the same lookup/create as the original servlet did?

      What prevents the stateful session bean from getting garbage collected?