开发者

How to Persist a DataSet to The Database when the Server is Rebooted

I have a dataset in cache and I don't want to lose the information in the cache even开发者_如何学Python if the server is rebooted. Is there a way to do this?


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.


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~

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜