views:

177

answers:

2

I have a dataset in cache and I don't want to lose the information in the cache even if the server is rebooted. Is there a way to do this?

A: 

Information should be continuously persisted to the database if you want to preserve it in case of a server crash or other act of god.

If you have a table(s) with the same schema in your catalog, I would think you could persist it to the database using a TableAdapter(s) fairly simply. This setup would also make retrieval of the cache quite simple when the server comes back up.

Check out this article: http://msdn.microsoft.com/en-us/library/bz9tthwx%28VS.80%29.aspx

~md5sum~

md5sum
+1  A: 

There are a variety of caching strategies, depending in part on whether the data needs to be persisted. If the data does need to persist, then what you need to do is called a "write-through cache". When the data is updated to the cache, immediately write it to the database. You don't need to restore from the database (except after a reboot or service restart), but your data is always safe. So the cache remains current, but your caching management is also responsible for making sure the database is current.

Cylon Cat