DotNetNewsgroup.com  
web access to complete list of Microsoft.NET newsgroups
   home   |   control panel login   |   archive  |  
 
  carried group
academic
adonet
aspnet
aspnet.announcements
aspnet.buildingcontrols
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
assignment_manager
datatools
dotnet.distributed_apps
dotnet.general
dotnet.myservices
dotnet.nternationalization
dotnet.scripting
dotnet.security
dotnet.vjsharp
dotnet.vsa
dotnet.xml
dotnetfaqs
framework
framework.clr
framework.compactframework
framework.component_services
framework.controls
framework.databinding
framework.drawing
framework.enhancements
framework.interop
framework.odbcnet
framework.performance
framework.remoting
framework.sdk
framework.setup
framework.webservices
framework.windowsforms
framework.wmi
frwk.windowsforms.designtime
lang.csharp
lang.jscript
lang.vb
lang.vb.controls
lang.vb.data
lang.vb.upgrade
lang.vc
lang.vc.libraries
  
 
start date: Thu, 16 Aug 2007 11:16:30 -0700,    posted on: microsoft.public.dotnet.framework.aspnet        back       

Thread Index
  1    hharry
          2    Mike
          3    Peter Bromberg [C# MVP]


Update cache object   
Hello All,

I save a Hashtable of stock symbols + prices to the cache. The prices
are updated every 30 minutes and saved to a database table.

I would like to always have the latest prices in the cache...is there
a way to dynamically update a cache object ?


Pointers appreciated
Thanks
Date:Thu, 16 Aug 2007 11:16:30 -0700   Author:  

Re: Update cache object   
Do you want the latest price prior to saving to the database or the price 
from the database?


"hharry"  wrote in message 
news:1187288190.606898.10300@r34g2000hsd.googlegroups.com...

> Hello All,
>
> I save a Hashtable of stock symbols + prices to the cache. The prices
> are updated every 30 minutes and saved to a database table.
>
> I would like to always have the latest prices in the cache...is there
> a way to dynamically update a cache object ?
>
>
> Pointers appreciated
> Thanks
> 
Date:Thu, 16 Aug 2007 14:21:00 -0400   Author:  

RE: Update cache object   
The basic pattern is as follows (pseudo-code):

1) get the "Stuff" - from the web, wherever
2) Store it in Cache with a timed expiration
3) Store it in the database if you want

Your "GetMyStuff" method will:
1) check if the cache item is null
2) if so, get the Stuff and update the Cache item
3) if not null, just get it right out of the Cache

This can all be done inside a single "getMyStuff" method so that the caching 
part
is opaque to the user/ caller.
-- Peter
Recursion: see Recursion
site:  http://www.eggheadcafe.com
unBlog:  http://petesbloggerama.blogspot.com
BlogMetaFinder:    http://www.blogmetafinder.com



"hharry" wrote:


> Hello All,
> 
> I save a Hashtable of stock symbols + prices to the cache. The prices
> are updated every 30 minutes and saved to a database table.
> 
> I would like to always have the latest prices in the cache...is there
> a way to dynamically update a cache object ?
> 
> 
> Pointers appreciated
> Thanks
> 
> 
Date:Thu, 16 Aug 2007 18:20:24 -0700   Author:  

Google
 
Web dotnetnewsgroup.com


COPYRIGHT ?2005, EUROFRONT WORLDWIDE LTD., ALL RIGHT RESERVE  |   Contact us