I know that:
For a stateless session with beans, the server can support a variable amount of instances in the pool. Each time the client requests such a stand-alone bean (for example, through a method), a random instance is selected to execute this request.
My question is: why do I need a pool? Should one stateless bean instance be sufficient to serve all requests?
Also, if the server for this idle bean uses a pool of 10 instances, is this 10 the maximum number of requests that it can process on such a bean?
Can you help me clear my doubts?
EDIT:
section 4.3.14 of the ejb 3.1 specification provides an answer.
4.3.14 Bean Session Serialization Methods The following conditions apply to a session of stateless beans. See Section 4.8.5 for Singleton session bean concurrency.
The container serializes calls for each state session and stateless bean instance. Most containers will support many bean sessions running simultaneously; however, each instance only sees a serialized sequence of method calls. Therefore, a state or session without a bean should not be encoded as reentrant.
( - -, , -, beforeCompletion ), -.
, ,
, , EJB
.
, , , 10 beans , 10 , bean.
, , .