We have a entity bean Employee. There are 10,000 records in Employee table. The container need not load that many entities. The container may load, say, 200 entities only. These beans don't actually represent the data at this time. It's when the user calls a biz. method, on entity bean, the data is loaded into a entity bean.
At what point container loads the entities in a pool? What decides, how many beans of a entity to load in a entity pool?
For stateless session beans we have DD elements to specify the no. of beans at starup, maximum no. of beans in pool, etc. Do same elements work for entity beans?
You are right, incase of Stateless beans we can specify how many bean instances we want at startup, but in case of Entity beans it's been taken care by container. All the finder methods are executed in the pooled state of the bean and still it depends upon container whether to load all the data after executing finder method(active loading) or delay it(lazy loading) till any business method is called.
We can only specify the maximum bean pool size taking performance into consideration.