Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Difference between using Session Scope or Stateful Session Bean

 
Jörg Beck
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

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?

Thanks in advance
Jörg
 
ntumba lobo
Ranch Hand
Posts: 180
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic