Originally posted by Deepak Acharya:
i strongly contradict the above given explanations.
I never said that the EJB Container does not pool instances. In fact, I explicitly stated that it does. However, in the intitial case I feel that most EJB Containers would indeed create 10 instances. Why not? The overhead of keeping 10 instances in memory is not great and is probably less then the overhead that swapping instances would incur.
If we talk about 10,000 rows then we are probably going to see dramatically different behavior. However, we really don't know enough about how the rows are being accessed. Is it concurrent access? Is it sequential access? Is it a huge finder that returns a Collection of 10,000 Entities? Is it accessing the same exact row 10,000 times?
The actual scenario will definitely affect how the Application Server handles it's bean pool and so will the Entity Bean cache settings. Has the Application Server's pool size been tuned manually, because this could also dramatically affect the behavior. Furthermore, various Application Servers may act in different ways (in fact I guarantee they will).
Basically, what I am getting at is there is not a single "correct" answer that can be given for the question. The question is too vague and there are too many variables in play...