0 Replies Latest reply on Dec 6, 2006 5:44 AM by Micho Edershvili

    Are RMI Stubs in JNDI Thread-safe

    Micho Edershvili Newbie

      I have a servlet talking to a Sessionbean.

      Is it allowed -regarding threadsafeness - to obtain the manager in the servlets init() method and store it in an instance-membervariable of the class.

      public class LzServlet extends HttpServlet {
      
       MandantenManager mm =null;
      
       public void init(ServletConfig config)
       {
       try
       { InitialContext ctx = new InitialContext();
       mm = (MandantenManager) ctx.lookup("BBCS/MandantenManagerBean/remote");
       }
       catch (Exception e)
       { e.printStackTrace(); }
       }

      Is getting the initialcontext and the lookup an "expensive" operation?