• 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

Updating variables in clustered environment

 
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
(instanceof Sidekick)
Posts: 8791
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 8945
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks a lot Stan James and Pradeep, i will try this out.
 
roses are red, violets are blue. Some poems rhyme and some are a tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic