Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Session Replication Mandatory?  RSS feed

 
Vinod Iyer
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does the specs make session replication in a distributable application mandatory ?
 
Rao Raghu
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
originally posted by Vinod Iyer
Does the specs make session replication in a distributable application mandatory ?



???
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you perhaps referring to the Serializable nature of objects stored in sessions? Being Serializable is essential even in non- distributed servers.

Bill
 
Vinod Iyer
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
no , let me explain.
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
 
D Rog
Ranch Hand
Posts: 472
Linux Objective C Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sure, it is. However if you put not serializable objects in session nothing (almost) can help.

More, if a balancer or what ever else can't provide session replication, then it will keep connected requests of the session to the same box.
 
D Rog
Ranch Hand
Posts: 472
Linux Objective C Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sure, it is. However if you put not serializable objects in session nothing (almost) can help.

More, if a balancer or what ever else can't provide session replication, then it will keep connected requests of the session to the same box.
 
Kartik Patel
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
According to me there are two aspects:
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.
 
Vinod Iyer
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
correct me if i am wrong .. container need not call the writeObject / readObject on the objects right ? Specs say all serializable objects will be replicated but its not guaranteed that the serializable interface methods that is writeObject / readObject will be called
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Specs say all serializable objects will be replicated but its not guaranteed that the serializable interface methods that is writeObject / readObject will be called


How would replication work if not by using the serialization functions?
 
Vinod Iyer
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Vinod Iyer
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I didnt know this when i asked , I had posted the same in my company forum there someone had replied to me .. I pasted the same text here
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!