• 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

Session Handling in clustering environment

 
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In a clustering envirnment. there are multiple servers handling user requests. when a user requests, a session is ceated on one server. when the same user makes the another request, it is served by the second server. will a new session for the same user be created on the another server. If not how will the second server, who is serving the request will handle the session. ? i mean wat will happen with the session.
 
Ranch Hand
Posts: 1561
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If we're talking about HttpSession (can't think of anything else), the servlet specification mandates that requests be served by only 1 JVM at a time. The container can migrate the session to a different JVM as well.
 
Ranch Hand
Posts: 237
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by raj jindal:
In a clustering envirnment. there are multiple servers handling user requests. when a user requests, a session is ceated on one server. when the same user makes the another request, it is served by the second server. will a new session for the same user be created on the another server. If not how will the second server, who is serving the request will handle the session. ? i mean wat will happen with the session.


My suggestion...
Don't use the HTTPSession to maintain conversational state (i.e. session).
Use SFSB. Look into support for fail-over via replication. You may also create and save the Handle to the SFSB to recover the session.
Cheers
 
Ranch Hand
Posts: 219
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Most servers implement this requirement by usage of a session persistence data store. The session info is the stored in the respository and the server manages the session. If one member of the cluster goes down, the heartbeat monitor algorithm of the cluster would indicate to the other member of the server to handle the requests from next time on.
 
when your children are suffering from your punishment, tell your them it will help them write good poetry when they are older. Like this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic