Skip to main content

Problem:

  • Product Name: BES App Server
  • Product Version: 5.x & 6.x
  • Product Component: EJB Container & Partition Log
  • Platform/OS Version: All
  • JDK/Compiler Version: Same versions bundled with BES

How to interpret details in BES Partition logs as "EJB Container Statistics"?

Resolution:

This article serves to explain some of the detials in the BES Partition logs and how to interpret them as "EJB Container Statistics".

EJB specification defines three states in the life cycle for an Entity Bean instance:

1. DOES NOT EXIST
2. POOLED
3. READY

Our BES implementation further extends the states by splitting "READY" state into two:

i) CACHED
ii) TRANSACTIONAL

In addition to the standard life cycle states, EJBs deployed in BES can have the following states too:

a) UNREFERENCED
b) KILLED
c) FINALIZED

Brief description of each states follows:

DOES NOT EXIST

 - No single instance of the bean in question exists physically.
 - Nothingness is implied here.

POOLED
 - Joins the group of instantiated, equivalent and "available" bean instances
 - Class.newInstance() & setEntityContext() called
 - Available to be "re-used"
 - No identity assigned; no EJBObject attached; no Primary Key related.
 - Size can be set by BES Entity Property "maxBeansInPool" (default is 1000)
 - If the pool exceeds the limit, entities will be removed (i.e., unsetEntityContext() called)

READY
 - Bean is fully qualified and ready to service the client requests
 - Sum of CACHED and TRANSACTIONAL beans
 - ejbCreate() & ejbPostCreate() called
 - A specific identity associated; EJBObject assigned; a Primary Key attached
 - Size can be set by the properties maxBeansInTransactions & maxBeansInCache

CACHED
 - READY beans with "Primary Keys" associated
 - No transactions involved
 - ejbActivate() called
 - "maxBeansInCache" determines cache size (default is 1000)
 - If the cache exceeds the limit, entities will be moved to the pool (i.e., ejbPassivate() called)

TRANSACTIONAL
 - READY and fully qualified beans with a transaction associated
 - ejbLoad() called
 - "maxBeansInTransactions" governs the size
 - Default size is determined by the factor of "maxBeansInCache" (i.e., maxBeansInCache/2)
 - Once completed, entities will return to the cached (ejbStore()) or pooled state (ejbRemove())

UNREFERENCED
 - Bean no longer referenced by the container
 - Enters into this state in a controlled manner (e.g., due to pool trimming)
 - Awaiting to be collected by GC

KILLED
 - Same as UNREFERENCED, but enters into this state due to un-checked exceptions
 (like NullPointerException in the bean or infrastructure code)
 - Awaiting to be collected by GC

FINALIZED
 - Number of beans re-claimed by the Garbage Collector

Below are the brief descriptions of other terms in EJB Container Statistics:

Total in Memory
 - Sum total of beans existing/lingering around in the memory
 - READY POOLED UNREFERENCED KILLED

Total in Use - Sum total of valid beans reachable and usable by the container
 - READY POOLED

Note:

  • Number of beans stated by "Total in memory" and "Total in use" can be the same if GC is happening frequently and statistics (which are printed at 5 seconds interval) are not capturing the beans in UNREFERENCED state
  • "Total in Memory" include those beans awaiting to be GC-ed.

#EJB
#Security
#VisiBroker