aspose file tools
The moose likes Servlets and the fly likes Info about clustering Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Servlets
Reply Bookmark "Info about clustering" Watch "Info about clustering" New topic
Author

Info about clustering

Mary Cole
Ranch Hand

Joined: Dec 02, 2000
Posts: 362
Hi,
I have a servlet which authenticates the user while he is logging in.If another person logs in with the same name , the first user will be displayed a message saying that the same user has logged on in another machine with the same login(The same scenario as in Yahoo messenger and AOL chat).
For this to achieve I am using HTTPSession to know the username who all have logged on
If I use clusters for load balancing and failover, whether my info in HTTPSession will be validated(replicated) for all the servers in the cluster so that any point of time only one user with the same username can log on.
Its urgent
Thanx in advance
Mirko Froehlich
Ranch Hand

Joined: Aug 21, 2000
Posts: 114
Hi Mary,
This might depend on your clustering implementation, but I don't think that the session is typically shared across servers. For this to work, you might need to use some kind of persistent storage instead, like a database, to store your state.
-Mirko

Originally posted by Mary, Cole:
Hi,
I have a servlet which authenticates the user while he is logging in.If another person logs in with the same name , the first user will be displayed a message saying that the same user has logged on in another machine with the same login(The same scenario as in Yahoo messenger and AOL chat).
For this to achieve I am using HTTPSession to know the username who all have logged on
If I use clusters for load balancing and failover, whether my info in HTTPSession will be validated(replicated) for all the servers in the cluster so that any point of time only one user with the same username can log on.
Its urgent
Thanx in advance

Mary Cole
Ranch Hand

Joined: Dec 02, 2000
Posts: 362
Hi Mirko Froehlich
Thanx for the reply.
Even if I have a persistent storage mechanism like Database how can we achieve this.

My assumption is this----
As soon as the user logs on, lemme say that a field in my table will have value "Y".
My doubt is , what if the user closes the browser without log out or what if the browser crashes.
My field will still have value of "Y" as the servlet is in memory.
Do reply
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Info about clustering
 
Similar Threads
HttpSession and not allowing multiple users to log in from same browser
Problem replicating ServletContext in the clustered environment
HttpSession sharing between browser instances on same machine!
Info about clustering
GWT IsSerializable,Serializable problem