Difference Stateful & StatelessSession Bean.

Discussions

EJB programming & troubleshooting: Difference Stateful & StatelessSession Bean.

  1. Difference Stateful & StatelessSession Bean. (2 messages)

    Hi,

    Here is a very dumb question from even dumb person.

    Well, I would want to know the difference between stateful session bean & a stateless session bean. Also, need to know which one to use where ?

    Rgds
    MT
  2. hi
     There's no wrong in that, as far as u deserved to learn.
    As the name itself suggests, stateless session cannot hold state ie keep track of a single client's sequential requests. It can hold only temporary values. eg. login bean when u log into some online shop site, stateless will be used

    On other hand, stateful session could hold the attributes of the session. eg. when user orders for different item and adds to the cart.

    Both doesn't survive system shutdown.

    Regards
    sundar
  3. Thanks Sundar for your clear and crips answer !!!