![](/images/new-backgrounds/1268749/268749105x1.webp)
EJB Container Settings
EJB Container Settings
The EJB Container has many settings that affect 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 Configurations >
Tuning the EJB Container
The EJB container caches and pools EJB components for better performance. Tuning the cache and pool properties can provide significant performance benefits to the EJB container. Set EJB cache and pool settings in the Admin Console Configurations >
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.
TABLE
Bean Type | Pooled | Cached |
|
|
|
Stateless Session | Yes | No |
|
|
|
Stateful Session | No | Yes |
|
|
|
Entity | Yes | Yes |
|
|
|
The difference 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 configured limits.
Chapter 3 • Tuning the Enterprise Server | 53 |