Win a copy of Machine Learning with R: Expert techniques for predictive modeling this week in the Artificial Intelligence and Machine Learning forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar

Static variable behavior in multi JVM env

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have defined a Map as a static variable and using it is as a cache. But when this map is getting updated the updated value is seen only in the JVM where it is updated.
What needs to be done to update the map value available on all the JVMs present on multiple nodes on multiple cells?

Thank you,
Ari
 
author & internet detective
Posts: 39540
778
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could use a distributed caching library. Or treat the static variable as a read only cache so you don't have to worry about updates.
 
Gajanan Gawhale
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Jeanne Boyarsky wrote:You could use a distributed caching library. Or treat the static variable as a read only cache so you don't have to worry about updates.



Thanks for your quick reply. I need to update the cache as well so cannot make it read only. Is 'distributed caching library' available by default in WebSphere Server?
 
Jeanne Boyarsky
author & internet detective
Posts: 39540
778
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
WebSphere offers Command Caching and Dynacache for a distributed cache. It is not on by default. And you have to use specific APIs rather than simply a static Map.
 
Blueberry pie is best when it is firm and you can hold in your hand. Smell it. And smell this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!