Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

passivate and activate is must for statefullsession bean  RSS feed

 
Sanju
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
For statefull session bean Passivation and activationis must? I will agree this one. but we are calling just empty method, what is the use ? if we are not calling these 2 methods and passing the parameters in create method what will happen ?

Sanju
 
Ravish Ahuja
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Sanju !
We some times want some code to be executed when ever the container passivates the bean. So we write that code in the ejbPassivate() methode.
so when ever passivation takes place our code in ejbPassivate() methode is also executed.
 
Damanjit Kaur
Ranch Hand
Posts: 346
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

For stateful session beans, empty activation and passivation methods are implemented by container to maintain instance pooling task. Where the bean instance data is written to disk during passivation and read into memory when activating the instance.

Passing parameter to create method may mean that you want to initialize some bean variable at the time of creation. But during some proceeding calls to methods which may or may not change its value, that latest bean value for each different user(the method invoker) will be retained by container while maintaining instance pooling thru activation and passivation process.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!