Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Updating variables in clustered environment

 
Arulanand Dayalan
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have an application which is deployed in clustered environment. In that while starting the application i call a servlet, in its init method i call the database and fetch some lookup values and store it in static variables to use it thorugh out the application. Now i have a fuctionality where i can change the lookup values and it should be reflected Immediately. I can do this one server, but i cant do that in remaining servers. Is there any way it can be done.
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Google for "Java distributed cache" for some open source and commercial solutions. Most involve something like JMS to notify all the machiens in a cluster when something changes. One small message you can send is just a cache key; the receiver invalidates or removes the cache entry and picks it up from the db on the next request.
 
Pradeep bhatt
Ranch Hand
Posts: 8927
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Arulanand Dayalan:
I have an application which is deployed in clustered environment. In that while starting the application i call a servlet, in its init method i call the database and fetch some lookup values and store it in static variables to use it thorugh out the application. Now i have a fuctionality where i can change the lookup values and it should be reflected Immediately. I can do this one server, but i cant do that in remaining servers. Is there any way it can be done.


Why dont you bind that object to JNDI?
 
Arulanand Dayalan
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot Stan James and Pradeep, i will try this out.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic