The instance pool maintainence is up to the implementation of the container. If
the
container provides one, it is available otherwise it is not mandatory for the
provider to implement it. Having said that, yes most of the container providers
implement the pooling functionality to increase
the performance of the app
server. How it is implemented, it is again up to the implementer.
Question What is the advantage of puttting an Entity Bean instance from
the "Ready State" to "Pooled state"? (EJB)
Answer The idea of the "Pooled State" is to allow a container to maintain a pool
of entity
beans that has been created, but has not been yet "synchronized" or
assigned to an EJBObject. This mean thatthe instances do represent entity beans,
but they can be used only for serving Home methods (create or findBy), since
those methods do not relay on the specific values of the bean. All these instances
are, in fact, exactly the same, so, they do not have meaningful state. Jon
Thorarinsson has also added: It can be looked at it this way:
If no client is using
an entity bean of a particular type there is no need for cachig it (the data is
persisted in the database). Therefore, in such cases,
the container will, after some
time, move the entity bean from the "Ready State" to the "Pooled state" to save
memory. Then, to save additional memory, the
container may begin moving
entity beans from the "Pooled State" to the "Does Not Exist State", because even
though the bean's cache has been cleared, the bean still takes up some memory
just being in the "Pooled State".
Do'stlaringiz bilan baham: