You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Alex Colic <al...@pop-ware.com> on 2001/04/18 19:00:23 UTC

Help with refreshing servletContext please.

Hi,

I am implementing a method of caching lists that I want available to all my
web users. I place lists in the servletcontext via:

    context.setAttribute("storeroomList",storerooms );

When the lists change I recall my cachelist method which gets the new data
and then put the list back into the session using the above line of code. I
thought that would replace the present list with the new one but
that is not occurring.

Is there another way I am supposed to be replacing attributes?

I thought about using removeAttribute followed by setAttribute but I am
worrying that someone might be accessing a page might need a list just as I
removing the list.

To test the problem I opened up a web page populated with my list and then
went to the database and changed some values in the list. My program then
caught these
changes, and repopulated the lists and then placed them in the context
again. I then opened up another window and the page was populated with the
old data.

Any help in this matter is appreciated.

Alex