What is the use of activate, passivate methods in EJB?

Questions by vidya_chintoo

Showing Answers 1 - 6 of 6 Answers

sreenivasulu

  • Apr 19th, 2006
 

Hi,

    ejb activate() and passivate() methods are playing good role in ejbs.

    ejb activate() is the method that donotes the objects which are at active state and at the same time passivate() tells us that objects which are at passive state(at sleeping condition).That means if we take an example like bottle.

If there are 10 bottels are in the box which currently using and means they are active and if u want to fill ane more bottle into that box then we should kept that bottle at another place and if u wants to be activate that 11th bottle then u must lift one bottle from first box and u fill the 11th bottle int that empty space.so,in this conclusion there is one thing iam telling u that if u want to use an object in activate state if there is no space in that part then u must passivate on item in that part must and only fill the one more object.

  Was this answer useful?  Yes

sin

  • Apr 19th, 2006
 

What an analogy!!

  Was this answer useful?  Yes

Deepak

  • Jun 27th, 2006
 

Pls refer/think before giving answers.

  Was this answer useful?  Yes

Pardeep Dureja

  • Aug 28th, 2006
 

It is used to save memory.Container invoke ejbPassivate( ) on the bean on the basis of least recently used algorithm and save it's state on disk, only serializable fields are saved and non serializable fields info is lost and when client call again the values are picked from disk by invoking ejbActivate( )Pardeep Dureja

  Was this answer useful?  Yes

bhargavi

  • Oct 25th, 2006
 

ur answer seems to be the one given like a kid

  Was this answer useful?  Yes

maulin rao

  • Nov 30th, 2006
 

This are call back methods It means container will call this method before it actually activate or passivate the bean. This gives you a chance to put your own logic to do some stuff like logging or clean up.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions