views:

310

answers:

2

Hi,

I'd love to hear people's views on the pros and cons of mixing SQL Cache Dependency with Linq to SQL, as described in this article:

http://code.msdn.microsoft.com/linqtosqlcache

This works for me, but I'm interested to know if anyone has any alternatives?

Cheers, Tim

+1  A: 

I was just about to ask same question. No comments still added on topic which surprises me, how do people cache with linqtosql anyway?

Also I've tried example in same post http://code.msdn.microsoft.com/linqtosqlcache

but have problem with usign that code on all tables in my database. Some tables work as expected but others always get cache key removed. What/where should I be looking at for this??

daniel
+1  A: 

According to my experience, Linq to SQL already does some sort of an optimistic cache. We had some problems with refreshes and stale data when using Linq to SQL and had to force flush before proceeding. This article might help: http://weblogs.asp.net/scottgu/archive/2007/08/27/linq-to-sql-part-8-executing-custom-sql-expressions.aspx I also know that it can also use ASP.NET Cache so searching using both these keywords might help.

Ritesh M Nayak
Thanks for the info. Searching along those lines took me to the article I mentioned above on MSDN. If anyone else has other solutions, please do post back. Cheers.
TimS