tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stacy Young <>
Subject RE: Query Caching
Date Fri, 28 Sep 2001 23:46:51 GMT
Breaks MVC? Not mine! (Fusebox)

-----Original Message-----
From: Geoff Lane [] 
Sent: Friday, September 28, 2001 6:52 PM
Subject: Re: Query Caching

Slightly off topic - but I've noticed A LOT of the traffic on this list is
about the DB Tag related stuff. Am I the only one who thinks that the whole
idea of DB tags (for anything other than a very trivial site) is really a
Bad Idea?

It just seems to me that the domain of storage and retrieval lies way
outside the domain of display. I'm willing to hear opinions on why people
use these - but they totally break MVC (which not everyone cares about I

And - if the queries where being done in regular Java and only being
accessed from Tag Labraries - then adding a layer of caching with a
WeakHashmap or something would be rather trivial - then you'd just have a
little penalty on a cache miss of having to do the query and add the value
back into the cache.

On that note - you might be able to sub class the DB Tags to have the
caching done based on the Query and some parameters passed in. Basically,
you'd need a singleton instance of the Cache class so that all the tags
could reference the same object (guess you'd need to do some synchronizing
on the object whenever you updated the cache). Not sure if singletons get
GCed - since they keep a reference to an instance of themselves - one for
someone who knows a lot more about the details of the VM than me.

Maybe a starting point at least . . .

On Fri, 2001-09-28 at 16:58, Stacy Young wrote:
> Is there a taglib that supports query caching? Say for isntance I'm 
> using a SQL Taglib to execute a database query, I'd like to hold the 
> results in memory for X amount of time so subsequent queries of the 
> same "id" are pulled from memory and not another trip to the DB.
> Thanks!
> Stacy Young
> Surefire Commerce
> tel: 514-380-2700 ext 3234
> <>
> "It all started with a Mouse." -Walt Disney
Geoff Lane <>
Ph: (773) 972-7136
PGP Key:

View raw message