I\'m reading a book on Java EE 6 and I met with the following parts:
\"Stateless: The session bean contains no conversational state between methods, and any ins
A real world example of a conversational state would be Shopping Cart. A user can add several items to shopping cart one by one and then call checkout. All the added times would be there
Suppose the cart is stateful, i.e. it will keep the conversational state.
cart.add(item1); // suppose cart keep tracks of item by adding it to ArrayList
cart.add(item2);
cart.checkOut(); // at this stage both item1 and item2 would be there in ArrayList.
If the cart is stateless, each call will be independent of previous ones and at checkout it can have nothing.
For your second point The distinction is necessary due to differences in behaviour of both beans. Maintaining state require resources therefore stateful beans are not as scalable as stateless beans.