My question is if a web application is distributed over two servers , iss sesson replication across both the servers mandatory or is it loan balancers responsibility to provide session replication. i am sure session failover is load balancer responsibility but i have doubt if web server has to take care of session replication
1) If there is only load balancer implemented, first request from one client will goto any of the underlying servers and session will get created over there. Now for the whole session load balancer will always send request to that perticular server.
2) In failover mechanism it is responsibility of Application server provider to migrate session to another server in cluster. (Application server should be configured for clustered environment).
As a developer you should only keep in mind to add serializable objects in session.
Originally posted by Ulf Dittmer:
How would replication work if not by using the serialization functions?
SRV.7.7.2 Distributed Environments :
If distributed containers persist or migrate sessions to provide quality
service features, they are not restricted to using the native JVM Serialization
mechanism for serializing HttpSessions and their attributes. Developers
guaranteed that containers will call readObject and writeObject methods
session attributes if they implement them, but are guaranteed that the
Serializable closure of their attributes will be preserved.
Developers guaranteed that containers will call readObject and writeObject methods session attributes if they implement them, but are guaranteed that the Serializable closure of their attributes will be preserved.
I think there's an "are not" missing between "Developers" and "guaranteed".
So what's the point of asking whether those methods must be called, if you're aware that the spec says they need not be called?
[ February 21, 2007: Message edited by: Ulf Dittmer ]