• Post Reply Bookmark Topic Watch Topic
  • New Topic

Session Handling in clustering environment

 
Raj Jindal
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • 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.
 
Andres Gonzalez
Ranch Hand
Posts: 1561
  • Mark post as helpful
  • send pies
  • 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.
 
Juan Rolando Prieur-Reza
Ranch Hand
Posts: 237
  • Mark post as helpful
  • send pies
  • 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
 
Nagendra Prasad
Ranch Hand
Posts: 219
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!