• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

tomcat separate instances accessing same data?

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,
I am facing a weird problem. It may even be silly. :P I have tried doing my research but it has been over 3 days and I have not found a solution.

My problem is:
I have a servlet which is deployed on two separate Tomcat instances, instance-1 and instance-2. There is a client which creates a connection with instance-1 (instance-2 is not started yet as it is supposed to be the failover for instance-1). Once the client makes a connection with the server, the srver stores some custom information about the connection. The client must not be aware of whether the server is instance-1 or 2. The client also sends a ping to the server after every two minutes. The server responds with an OK in a custom header if and only if it finds the information that it had stored upon client creating the connection. In between two consecutive pings sent by the client, I want to switch from instance-1 to instance-2. I turn off instance-1. and turn on instance-2. The server.xml of both instances are identical. I want them to run on same port. The connections that the client had made with instance-1 must be recreated with instance-2. But the information about it was stored by instance-1, so instance-2 would not have it. Instance-2 must thus respond with a NOT OK in custom header which will tell the client to re-establish connection with instance-2. However, in my case, when I run instance-2, it still finds the connection information and responds with OK. Both tomcat instances are in separate folders in separate drives. I am new to tomcat and dont understand why is it behaving this way. Is the connection information being stored in a location accessible to instance-2? if so, Why?! and HOW!? Please help. I hope my problem is clear from the above explanation. I am new here so please bear with me.
 
Saloon Keeper
Posts: 27762
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You didn't say WHERE you are storing this data. Is it in session scope, a database or what?

Offhand, I'd say that your client is caching something, but without further information that's merely a guess.
 
shalakha sidmul
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

You didn't say WHERE you are storing this data. Is it in session scope, a database or what?



Sorry about that, the data is stored in session scope.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic