The container must ensure that only one thread can be executing an instance at any time. If a client
request arrives for an instance while the instance is executing another request, the container may throw
the java.rmi.RemoteException to the second request if the client is a remote client, or the
javax.ejb.EJBException if the client is a local client.[9]
Note that a session object is intended to support only a single client. Therefore, it would be an
application error if two clients attempted to invoke the same session object.
One implication of this rule is that an application cannot make loopback calls to a session bean instance.

解决方案 »

  1.   

    I am talking about "statless" session Bean.As my understanding "statless" session Bean can handle much more clients than stateful session Bean with much less instances. it suggests that One single Stateless Session Bean can handle more than one request at a given time.  
    If I misundertood stateless concept, please correct me.Thanks
      

  2.   

    对于session不管是不是有状态的,一个bean实例同一个时刻只能为一个
    client服务。
    对于stateless 来说,客户端在调用方法的时候,是首先从pool中挂接
    bean实例到ejb对象的,
    所以bean实例是线程安全的。如果pool中没有可用的bean实例,容器会自动
    生成bean实例的,不存在瓶颈
      

  3.   

    EJB本身是不具备多线程的,容器在调用时会从实例池中提取一个实例,所以看起来象是多线程的