Updates
  • Starting New Weekday Batch for Full Stack Java Development on 27 September 2025 @ 03:00 PM to 06:00 PM
  • Starting New Weekday Batch for MERN Stack Development on 29 September 2025 @ 04:00 PM to 06:00 PM

Session Migration

• When you have a large-scale enterprise application, lakhs of users may visit the application at a time.
• To manage thousands of users concurrently, you need to implement a clustered environment with more load-balancing servers and more application servers.
• When the user sends the request, LBS first take that request and forward it to a free servlet at Clustered Unit.
• Sometimes one user request may be forwarded to different servers.

• The user's first request is given to Server 1, where a session object is created for that user.
• User second request given to Server 3.
• Now the session object of that user is required on Server 3.
• In this case, you have to migrate the session object from Server 1 to Server 3.
• The following events will happen at session Migration:

o Sessions will be passivated on Server 1.
o A session will be activated on Server 3.

• To perform any task at these events, you must register.

HttpSessionActionvationListener with the following methods:

o Void session Will Passivate(event): will be called by the web container at SERVER 1.
o Void session DidActivate(event);will be called by the web container at SERVER 3.