> One question about caching data in servletcontext, 
> u said some thing about timestamp, what this timestamp
> do exactly, how will i come to know when to reload the
> data using this timestamp,

It was an idea off the top of my head... I haven't implemented it.  I was
thinking you would set a fixed "expiration" time, and if the data was older
than that, say 24 hours, then your implementation of Collection would go
read the database before returning the data.

> Also suppos the data i ahve to cache does not modify
> so often , but it modifies once in 15 - 20 days, but
> by some different application , so how will i refresh
> data in cache??

Unless you can get the database to notify your object when things change, I
don't see a way to know (without the db read that we were trying to avoid)
that you need to refresh.  Hence the fixed expiration time I tossed out as
an idea.

If my data only changed every 15-20 days, I would stick with my current
approach of a ServletContextListener placing a bunch of Maps in application
scope, and just reload the webapp when the data needs to change.  But I
don't have an uptime target to reach or a large number of users, so if I
bounce the webapp on Sunday afternoon, nobody's going to know.  YMMV.

-- 
Wendy Smoak
Applications Systems Analyst, Sr.
Arizona State University PA Information Resources Management

Reply via email to