At 01:44 PM 10/27/2000 -0400, you wrote:
>Hi,
>
>I'm creating an application and trying to figure out how I can
>cache data using Servlet in application scope. The info can be
>refreshed during a day, and application has to be available 24/7 ( so
>it's not possible to restart the servlet and refresh cache). E.g.
>product list that can be changed during a day.
>
>Also the problem that I encounter with any approach is that I'll have to
>make all access methods synchronized. Since data will change rarely, it
>will be very inefficient to make getters synchronized. Did anybody solve
>this problem? Is it better to have static class that will serve as cache
>instead of putting data in application scope?
>
>Thanks
>
I, too, would like to cache data on webservers to improve performance;
Currently that is limited to very static data - a collection of objects
representing US states, territories and districts (DC) and Canadian provinces.

All of the other data in my application is subject to change at most any time,
although in reality most changes infrequently.

We have the additional problem that we use a server farm of 1 reserve and 5
active servers, and need to synchronize 5 caches with the database;  I will not
allow the implementation of any application which behaves differently if any
request is executed on one server rather than another;  That could happen if
older data is cached on one server and not on another, and newer data would
then be obtained from the database.

The solution I proposed (still negotiating) is for the database (Mainframe DB2
or Solaris Oracle) to broadcast a message from a database trigger to all web
servers when certain data is updated, deleted or inserted. Programs listening
on the web servers' Servlet engines could invalidate all or part of the cached
data.

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to