This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Info about clustering

 
Mary Cole
Ranch Hand
Posts: 362
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 114
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 362
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic