Stateless Session Beans and Singleton Objects....


EJB design: Stateless Session Beans and Singleton Objects....

  1. Hi ,

    This might be dumb question . But I could not figure out the point of Pooling Stateless Session Beans.

    Why cant the container always return the same instance of Stateless Session Bean . Bean Stateless it is Thread safe and all method calls will execute on different stacks .

    Similar to the Singleton Object .

    Why do we pool Stateless Session BEans...

    Input ????

  2. Hi neeraj
    as stateless session beans are not going to survive in server crash and they wont store any client information in form of varibles or attributes so what is the use of kepping them in pool.for example for online enquary and reservation system if any client comes and wanted ask for only enquary so our components will give him/her only status and who is coming next time our component is not at all bothering abt that its like telephone system how it works.On the contrary if we are talking abt online reservation system we need to update the status of the user daily basis then component need to know the history of his booking time and all so here in this case we are holding the data for the each client.
    so by object pooling mechanisam will helps us to serve concurrent clients.
    does above lines make any scence revert me back on
    s dot manoj at zensar dot com
  3. hi neeraj

    rectify one line in early message
    read stateless seesion beans are also in pool but they wont holds any information for any client and another line is also concurrency is not at all issue in session beans.
    Sory for iconvenience