Sun Microsystems 820434310 Server User Manual


 
EJB Container Settings
The EJB Container has many settings that aect performance. As with other areas, use monitor
the EJB Container to track its execution and performance.
Monitoring the EJB Container
Monitoring the EJB container is disabled by default. Enable monitoring with the Admin
Console under Congurations > cong-name > Monitoring. Set the monitoring level to LOW
for to monitor all deployed EJB components, EJB pools, and EJB caches. Set the monitoring
level to HIGH to also monitor EJB business methods.
Tuning the EJB Container
The EJB container caches and pools EJB components for better performance. Tuning the cache
and pool properties can provide signicant performance benets to the EJB container. Set EJB
cache and pool settings in the Admin Console Congurations > cong-name > EJB Container
(EJB Settings).
The pool settings are valid for stateless session and entity beans while the cache settings are
valid for stateful session and entity beans.
Overview of EJB Pooling and Caching
Both stateless session beans and entity beans can be pooled to improve server performance. In
addition, both stateful session beans and entity beans can be cached to improve performance.
TABLE3–1 Bean Type Poolingor Caching
BeanType Pooled Cached
Stateless Session Yes No
Stateful Session No Yes
Entity Yes Yes
The dierence between a pooled bean and a cached bean is that pooled beans are all equivalent
and indistinguishable from one another. Cached beans, on the contrary, contain conversational
state in the case of stateful session beans, and are associated with a primary key in the case of
entity beans. Entity beans are removed from the pool and added to the cache on ejbActivate()
and removed from the cache and added to the pool on ejbPassivate(). ejbActivate() is
called by the container when a needed entity bean is not in the cache. ejbPassivate() is called
by the container when the cache grows beyond its congured limits.
EJB ContainerSettings
Chapter3 • Tuningthe EnterpriseServer 53