Why stateless EJB pool is needed

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. , , .

+4
3

bean, , , , . bean bean.

bean , , .

, instainess ejb :)

, , , singleton session bean bean bean , , .

10 , , 10 .

+1

EJB , . EJB . EJB . , .

, ginen bean 10 , 10 , bean?

10 10 .

0

EJB . (?)

I will explain. There are some states in stateless EJBs, such as a flag, in order to know if EJB / hibernate is working or if EJB is loaded and so on. Ie, the stagnant EJB has hidden fields .

-1
source

All Articles