This week's book giveaway is in the OCMJEA forum. We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line! See this thread for details.
I've problems to understand when to use the session scope or use a stateful session bean to maintain a conversational state (example: online-shop-cart).
How are those scopes (session, page, request and application) realized under the hood in Java EE?
Both the session scope and the SFSB allow to keep user specific data across multiple requests on the server side.
Session scope you can only use it in the context of a web application whereas SFSB is more generic and you can it for web and non-web application.
Usually if you develop a web application serving only web clients you will use the session scope to keep the conversational state, SFSB have a negative impact on perf and scalability.
But if your logic is for web and non-web clients or non-web clients only you will use SFSB.
I hope this clarifies things a bit for you