I have written an application very similiar to yours. My servlets contain a
cache class, rather than using the servlet itself as a cache. Im not sure
if this is what you meant. But, if you are looking for reasurance...it
works nicely. If you are planning to have users write elements and queries,
dont forget to make it thread safe.. :)
I would suggest creating an abstract servlet. This abstract servlet should
have a reference to your cache object. Then have your other servlets extend
the abstract servlet. The cache object will be inheritely static so all
servlets will have a reference to one cache object. Hope this helps. :)
-Todd
>From: Brad Johnson <[EMAIL PROTECTED]>
>Reply-To: "A mailing list for discussion about Sun Microsystem's Java
> Servlet API Technology." <[EMAIL PROTECTED]>
>To: [EMAIL PROTECTED]
>Subject: Re: A DB Cache...Servlet?
>Date: Thu, 20 Jul 2000 13:07:08 -0700
>
>I'm currently building a web-based intranet that will serve 30-100 people
>all day long (the ability to scale should be preserved, though). Each page
>of the site will display large amounts of information extracted from an
>Oracle Database and formatted/distributed by servlets and JSPs. Anywhere
>from 15-20 different SQL queries should be able to gather the majority of
>the information that needs to be displayed on the front end.
>
>To avoid hammering the DB every time the results of a common query is
>needed
>(and to keep the number of db connections low), it would be nice to cache
>the common query results in an object or as class data for a number of
>objects. The object(s) would have to persist until the server was
>shutdown.
>Rare queries that do not match one of the standard 15-20 would warrant a
>connection to the db. Also, the cache object would need to be notified if
>any changes were made to the DB so that it could repopulate itself.
>
>Would a servlet be well equipped to act as an cache for db information, or
>is there another more standard means of doing this? Am I completely off
>track? Any advice would be greatly appreciated.
>
>Thanks
>brad
>
>___________________________________________________________________________
>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
________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com
___________________________________________________________________________
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