Uday,

why don´t you just implement a kind of "secret area" (similar to the
password-protected /admin-zone in Tomcat), that allows you to reload this
data manually (and therefore gently, for it rarely changes and you don´t
have to restart the server). If you put the object bearing the same key into
the session, the old instance should be deleted (hashtable), and the new
values should be present.

Regards,

Michael

-----Ursprüngliche Nachricht-----
Von: Natra, Uday [mailto:[EMAIL PROTECTED]]
Gesendet: Dienstag, 17. April 2001 15:35
An: '[EMAIL PROTECTED]'
Betreff: RE: how to cache lists?


Alex, It is a good idea from a developers point of view. But when U say this
to an IT manager and also tell him that U have to restart the webserver when
ever new data is added, he/she will not allow U to do that. I faced the same
situation but gave up on the idea of caching the data at application level.

Thanks,
Uday.

-----Original Message-----
From: Alex Colic [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 17, 2001 8:15 AM
To: Struts
Subject: how to cache lists?


Hi,

Lets say you have a web app that runs over a number of web pages in a wizard
fashion. On each one of these pages you need to present the user with a
select box holding lists. e.g. locations, cities, etc. This data is read
from a database and rarely changes.

How would you cache these lists so that as each user access this site they
do not need to have this info downloaded again?

I was thinking in the init() of my ActionServlet to access the database and
get these lists then place them in the session with Application scope. I
think this would allow each user to access the data without reaccessing the
database.

Any comments or suggestions are appreciated.

Regards

Alex

Reply via email to