|
|
| EJB |
Expert:Shyam Sunder Reddy
Why ejbActivate() and ejbPassivate() methods are dummy methods in Stateless session bean |
| Answers |
Hi friend,
As the name implies, a Stateless session bean does not maintain any state (instance variables values) across methods for a particular client, ejbActivate () and ejbPassivate () methods do not have significance in Stateless session bean. So the Container can assign different beans from the pool to the client for successive methods so developer needs not to write code in these methods for stateless session bean.
The app server ur using cannot always instantiate as many beans as the number of active sessions, for the very reason that it is resource hungry. For eg, if there are 100 clients communicating with ur server, there will not always 100 session beans servicing the clients.. instead the container instantiates a reasonable number of bean instances, say 25, to service the 100 clients simultaneously.
Now, the interesting problem of managing the 100 clients with 25 bean instances is with the container. The ejbPassivate() and ejbActivate() methods give a helping hand to the Container to effectively manage the resources.
For more information on Java Beans
http://www.roseindia.net/javabeans/javabeans.shtml
http://www.roseindia.net/ejb/
Thanks
|
| More Questions |
|
|
Post Answers
Ask Question
Facing Programming Problem?
|
|
|
|
|