title: How to clear the DataContext cache on Linq to Sql
body: <p>I'm using Linq to Sql to query some database, i only use Linq to read data from the DB, and i make changes to it by other means. (This cannot be changed, this is a restriction from the App that we are extending, all updates must go trough its sdk).</p>
  
  <p>This is fine, but I'm hitting some cache problems, basically, i query a row using Linq, then i delete it trough external means, and then i create a new row externally if i query that row again using linq i got the old (cached) data.</p>
  
  <p>I cannot turn off Object Tracking because that seems to prevent the data context from auto loading associated propertys (Foreign Keys).</p>
  
  <p>Is there any way to clear the DataContex cache? </p>
  
  <p>I found a method sufring the net but it doesn't seem safe: <a href="http://blog.robustsoftware.co.uk/2008/11/clearing-cache-of-linq-to-sql.html" rel="noreferrer">http://blog.robustsoftware.co.uk/2008/11/clearing-cache-of-linq-to-sql.html</a></p>
  
  <p>What do you think? what are my options?.</p>