aspose file tools*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes web session migration Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "web session migration" Watch "web session migration" New topic
Author

web session migration

Maan Suraj
Ranch Hand

Joined: Dec 20, 2007
Posts: 299
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


Man Suraj
Someone says "Impossible is nothing". The man next him says "Let me see you licking your elbow tip!"
bhanu chowdary
Ranch Hand

Joined: Mar 09, 2010
Posts: 256
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

Joined: Dec 20, 2007
Posts: 299
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

Joined: Feb 29, 2008
Posts: 1105
    
    1

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


Oracle Java Web Service Developer (1z0-897), Oracle certified Java 7 Programmer, SCJA 1.0, SCJP 5.0, SCWCD 5.0, Oracle SQL Fundamentals I
 
Consider Paul's rocket mass heater.
 
subject: web session migration