0

I haven't worked with EJB. Every now and then I hear about the terms "activation" and "passivation" in context of EJB's. Maybe these terms are equally applicable for normal POJO objects also.

Are these two concepts different names for the concept of deseralization and serialization respectively, or is there more to it than this?

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
Geek
  • 26,489
  • 43
  • 149
  • 227

2 Answers2

2

Yes, passivation will work as serialization and activation will work as deserializatoin of EJB's.

Basically, the ejbActivate() and ejbPassivate() methods are callback methods for EJB stateful session beans. Internally, these methods will perform serializarion and deserialization, saving the state of the beans.

Magnilex
  • 11,584
  • 9
  • 62
  • 84
NPKR
  • 5,368
  • 4
  • 31
  • 48
0

Activation and passivation are only applicable to EJB stateful beans. EJB container may passivate a bean which means to save its state (using serialization) in a database and remove it from memory, and later activate the bean that is instantiate an instance and load its state from DB (using desirialization).

Evgeniy Dorofeev
  • 133,369
  • 30
  • 199
  • 275