• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Difference between using Session Scope or Stateful Session Bean

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 180
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
reply
    Bookmark Topic Watch Topic
  • New Topic