Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

EJB Bean passivation

I have read that when ejbPassivate() is called Stateful Session Beans are usually evicted but Entity Beans and Stateless Beans are pooled which means they are not appilicable for passivation.

In another article I have read that activation and passivation is applicable only for Stateful Session Beans and Entity Beans which is a contrast to the claim that Entity Beans and Stateless Beans are pooled.

For what beans does the passivation apply and what does really happen when they do?

like image 564
FrankD Avatar asked Jan 15 '23 21:01

FrankD


1 Answers

Passivation and Activation only apply to EJBs that have state, namely stateful session beans and entity beans.

Passivation is the process by which any state a given bean has is moved into storage.

Activation is the process by which any state that a given bean previously had is loaded from storage.

This mechanism is needed because the EJB contain creates a pool of each bean type but gives the illusion that there are an infinate number of each bean, loading and storing them using the ejbActive and ejbPassivate methods respectively as needed.

The full life-cycle of each bean type is described here:

Stateless Session Bean

Stateful Session Bean

Entity Bean

like image 200
Nick Holt Avatar answered Jan 22 '23 07:01

Nick Holt