V
Vishu
Hi Folks,
I am facing a problem with (Static member) hashmap in a singleton
class. I have a class (Say B, a servlet) that is loaded into memory
during the server's startup. This performs some booking tasks every 10
mins and keeps updating another class (Say A) which is a singleton
class and which has a static hashmap as its member. So the servlet is
updating the data say every 10 mins. Now everything is OK when I access
the servlet over the web (I get the required data; all the servlet does
is, lookup the content in the static hashmap and serve it to the user).
But I am facing a problem when a class (Say C) in a different web
application context (on the same server) is trying to get some data
from the single class A. It passes the same request parameter as the
servlet (class B) does in the initial application, but from class C,
when I try to lookup the hashmap, I dont find any entry for the same
key.. Why is this..?
Thanks!!
I am facing a problem with (Static member) hashmap in a singleton
class. I have a class (Say B, a servlet) that is loaded into memory
during the server's startup. This performs some booking tasks every 10
mins and keeps updating another class (Say A) which is a singleton
class and which has a static hashmap as its member. So the servlet is
updating the data say every 10 mins. Now everything is OK when I access
the servlet over the web (I get the required data; all the servlet does
is, lookup the content in the static hashmap and serve it to the user).
But I am facing a problem when a class (Say C) in a different web
application context (on the same server) is trying to get some data
from the single class A. It passes the same request parameter as the
servlet (class B) does in the initial application, but from class C,
when I try to lookup the hashmap, I dont find any entry for the same
key.. Why is this..?
Thanks!!