[jboss-user] [EJB/JBoss] - StatelessHandleImpl caching handle

raghu56 do-not-reply at jboss.com
Tue Oct 23 05:08:05 EDT 2007


The getEJBObject() in StatelessHandleImpl has the following code.
Does this mean that caching the handle is bad for stateless session beans. 
public EJBObject getEJBObject()
         throws ServerException
   {
      try
      {
         InitialContext ic = null;
         if( jndiEnv != null )
            ic = new InitialContext(jndiEnv);
         else
            ic = new InitialContext();
         EJBHome home = (EJBHome) ic.lookup(jndiName);
         Class type = home.getClass();
         Method method = type.getMethod("create", new Class[0]);
         return (EJBObject) method.invoke(home, new Object[0]);
      }
      catch (Exception e)
      {
         throw new ServerException("Could not get EJBObject", e);
      }
   }

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4097745#4097745

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4097745



More information about the jboss-user mailing list