RE: what is the use of activate, passivate methods in ...
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.
RE: what is the use of activate, passivate methods in ...
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
RE: what is the use of activate, passivate methods in ...
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.