0

I have web application deployed on WebSphere Community edition (WAS CE) server on four different machines for load balancing purposes. I want to store some constant variables/objects among the four servers. If I change the variable in web application on one server, the same copy should be available for the web apps on the other three servers. Since these variables/objects are not related to the user session, sticky-session will not help here. Is JNDI the best solution? kindly share your knowledge on any other better solutions/techniques.

OS: Linux
Application Server: WebSphere Community edition (WAS CE).

Michael Petrotta
  • 59,888
  • 27
  • 145
  • 179
gang010
  • 3
  • 3
  • I disagree with the vote to close. This isn't a ServerFault question, as the question has more to do with JavaEE in general than with WAS CE in particular. – Isaac Jan 06 '14 at 03:54

1 Answers1

1

If these values don't change during runtime, then placing those variables in the ServletContext scope would make most sense.

If these values do change during runtime, then they will have to reside in a storage medium that is accessible by all servers in your cluster. I'm not sure that JNDI would work for you though (I can't recall anything from the JEE spec mandating synchronization of JNDI trees across containers); distributed cache frameworks such as EHCache would make more sense.

Isaac
  • 16,458
  • 5
  • 57
  • 81
  • Thanks for your reply. The EHCache/Haselcast resloved my problem. These are really good frameworks for the highly distributed environment. – gang010 Jan 06 '14 at 20:10