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

web session migration

 
Maan Suraj
Ranch Hand
Posts: 299
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have confusion in understanding web session migration
Lets say an eg
I'm browsing through an online site. Say i select few items and am going to checkout page. When I decide to pay,say the node/box my request landed initially(Server1) got crashed (or say load balancer moved my request to another node ..server 2)and I was transparently rerouted to another working node/server(Server 2).I want to know what happens to my session stored on Server1?Is it still there holding the key/objects etc
 
bhanu chowdary
Ranch Hand
Posts: 256
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
From HFSJ
there is only one HttpSession object for a given session ID per web app, regardless of how many VM’s the app is distributed across
.

Hope this helps.
 
Maan Suraj
Ranch Hand
Posts: 299
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
but then why do we need to use external replications tools like "terracota" or "cluster" entries in tomcat?


tomcat site

Also see below article

web sessions Please see section Server session replication What is it then exactly?
 
Abhay Agarwal
Ranch Hand
Posts: 1376
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
why do we need to use external replications tools like "terracota" or "cluster" entries in tomcat?


we require clustering for load balancing and to achieve 99.9% availability of website to end user over internet/intranet.


Please see section Server session replication What is it then exactly?


This is the scenario to overcome session loss due to server crash.
Every application server implement Session replication in its own way.
more details of it is already mentioned in your URL.

there is still only one HttpSession object for a given session ID per web app even after session replication happened.
For example - User is maintaining a session with server node 1 (with session id as Sess_Id1). Now server node 1 crashes and you have clustered (and all objects are serializable in session) setup, so User will be shifted to server node 2. Application server will use its mechanism to recreate that HTTPSession object again with same session id (Sess_Id1). But in this process, session object of server node 1 (associated with Sess_Id1) has already died since server node 1 got crashed. So in all , Sess_Id1 still have one HTTPSEssion object assciated to it in clustered eniv.

~ abhay

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic