Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

sharing session among two servers in a distributed application

 
Pratibha Malhotra
Ranch Hand
Posts: 199
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How can we share session among two servers lying on two different machines in a distributed application.
 
David Bridgewater
author
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rewa,

That will depend on the application server you are dealing with.

I happen to be familiar with IBM WebSphere Application Server. As an administrator, you can switch on session replication across the running instances of your distributed application (and there are different options with different performance/failover trade-offs). You also have some configuration to do in the associated web server (usually IBM Http Server).

I don't know the answer for open source application servers, but I think you will find plenty of resources to help you. Here is a thread which talks about clustering with Tomcat (as the web container) and Apache (as the web server):

ServerSide.com discussion on Tomcat / Apache clustering

Whichever tools you are using, you shouldn't have to alter your coding approach - the session object should be up-to-date and available to whichever running instance your requests go to.

HTH -

David.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic