Meaningless Drivel is fun!*
The moose likes Servlets and the fly likes Updating variables in clustered environment Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Updating variables in clustered environment" Watch "Updating variables in clustered environment" New topic
Author

Updating variables in clustered environment

Arulanand Dayalan
Ranch Hand

Joined: Aug 10, 2005
Posts: 124
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

Joined: Jan 29, 2003
Posts: 8791
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.


A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8904

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?


Groovy
Arulanand Dayalan
Ranch Hand

Joined: Aug 10, 2005
Posts: 124
Thanks a lot Stan James and Pradeep, i will try this out.
 
 
subject: Updating variables in clustered environment
 
Similar Threads
Clustered JBoss Application Server nodes synchronization ?
Sync'ing files in clustered environment
Clustered Singleton
JSF Portlet and instance variables
Start working with clustured applications