This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Servlets and the fly likes load balancing & session management Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "load balancing & session management" Watch "load balancing & session management" New topic
Author

load balancing & session management

Shrawan Bhageria
Ranch Hand

Joined: Jun 20, 2005
Posts: 52
hi all

pl. help me

how we maintain session management in case server load balancing.
pl. explain with example

thanks
shrawan

SCJP 1.4, SCWCD 1.4, MCP
SCBCD(preparing)
Paul Bourdeaux
Ranch Hand

Joined: May 24, 2004
Posts: 783
The answer is going to be specific to the type of server you are using. An application server is not required to support distributed applications, but most do.

Basically, servers that support load balancing and clusters maintain session information in some type of datastore that each cluster machine can access. If a request comes into a machine, and its session exists on a different machine, the container will migrate the session to the machine servicing the new request.

The key point here is that there is only one session per distributed application, and the application server handles all of the migration for you. You can use an HttpSessionActivationListener if you want trigger events when the session is migrated.


“Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.” - Rich Cook
stan ioffe
Greenhorn

Joined: Jun 30, 2005
Posts: 16
You can also serialize session data onto a disk and allow a different machine reload that data. ... However, as mentioned above, it's server specific.
-stan
 
wood burning stoves
 
subject: load balancing & session management
 
Similar Threads
Session Mgmt Across Multiple WebLogic Systems
Is it true????
Load Balancing , failover , session replication
load balancing
Which Server to choose?