• 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

Statefull session Bean Vs Servlets Session

 
Ranch Hand
Posts: 1491
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How Statefull session Bean is better than Servlets Session?
 
Ranch Hand
Posts: 312
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by kri shan:
How Statefull session Bean is better than Servlets Session?



I think both are working in different context but for the same purpose as session tracking.

In the servlet session you have to store all the values explicitly but in SFSB the container does the job for you.

Using SFSB will hit the performance as one SFSB is attached with one client.

If your appln uses the servlet & SFSB then store the values in serlvet session instead of SFSB.
 
kri shan
Ranch Hand
Posts: 1491
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Then what is the use of SFSB?
 
Ranch Hand
Posts: 704
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


How Statefull session Bean is better than Servlets Session?


That�s not always true and is not actually the point. Only because SFSB and HttpSession can both be used for storing conversational state, it doesn�t necessarily mean that you have to compare both technologies only through this feature. They both have different capabilities and solve a different set of problems. However if you are strictly interested which of the two manages the session information better, then let me tell you this: HttpSession is preferred; and not only from a design persperctive, but here there is a strong reason why WebLogic recommends managing sessions through HttpSession.
For both HttpSession and SFSB WebLogic uses an in-memory replication algorithm within a cluster (I already explained this principle on this forum several times now). In order to replicate the HttpSession object WL keeps track of the data that changed in the HttpSession. WL can easily do that because the container knows that the clients call setAttribute() method in order to change the HttpSession object. Therefore the server will replicate only the part of the session that was changed and not the whole session object. However the container has no way to figure out which data was changed in a SFSB and which data was not; WL replicates always the entire SFSB.
 
I brought this back from the farm where they grow the tiny ads:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic