struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rick Reumann" <>
Subject Re: some best practices questions
Date Wed, 07 Jul 2004 15:00:54 GMT
On Wed, 07 Jul 2004 13:57:23 +0200, Bryan Hunt <>  

> For instance if I want to page through it ( using (10  
> out of 10)) or simply if I don't want to fetch
> from the database time and time again.
> By default the data expires on an hourly basis. And if a different  
> combination of parameters is sent it expires
> the cached stuff.

Nice code, but if you use iBATIS for your  
persistence layer you get all of that functionality out of the box. Takes  
care of all the caching for you. It'll even always flush the cache  
whenever an update or insert is peformed. So basically you make the same  
simple DAO call... ie. myDao.getMyList().. and you don't have to worry  
about it whether you need a fresh query or not.

Unfortunately as cool as caching is, in many(most?) situations the  
database is not just modified by your application, so you can't rely on  
the cache being flushed at appropriate times. For example say the  
inventory to display is updated in the database by some other process  
outside of your web application. When displaying the inventory you always  
want to make sure you have the most recent inventory so you can't rely on  


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message