Sun Microsystems 820434310 manual EJB Container Settings, Monitoring the EJB Container

Models: 820434310

1 128
Download 128 pages 34.03 Kb
Page 53
Image 53
EJB Container Settings

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 > config-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 significant performance benefits to the EJB container. Set EJB cache and pool settings in the Admin Console Configurations > config-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.

TABLE 3–1Bean Type Pooling or Caching

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

Page 53
Image 53
Sun Microsystems 820434310 manual EJB Container Settings, Monitoring the EJB Container, Tuning the EJB Container