This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Static variable behavior in multi JVM env

 
Gajanan Gawhale
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
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34084
337
Eclipse IDE Java VI Editor
  • 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
Marshal
Posts: 34084
337
Eclipse IDE Java VI Editor
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic