<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Lifetime of a LINQ to SQL DataContext</title><link>http://blogs.msdn.com/dinesh.kulkarni/archive/2008/04/27/lifetime-of-a-linq-to-sql-datacontext.aspx</link><description>One of the frequently asked questions is about the lifetime of a DataContext. Should it be a long-lived, application-scoped object or should it be a short-lived, request-scoped object? Let's get to the answer by considering the key parameters: DataContext</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Microsoft news and tips &amp;raquo; Lifetime of a LINQ to SQL DataContext</title><link>http://blogs.msdn.com/dinesh.kulkarni/archive/2008/04/27/lifetime-of-a-linq-to-sql-datacontext.aspx#8434433</link><pubDate>Mon, 28 Apr 2008 08:34:47 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8434433</guid><dc:creator>Microsoft news and tips &amp;raquo; Lifetime of a LINQ to SQL DataContext</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://microsoftnews.askpcdoc.com/data-access/lifetime-of-a-linq-to-sql-datacontext-2"&gt;http://microsoftnews.askpcdoc.com/data-access/lifetime-of-a-linq-to-sql-datacontext-2&lt;/a&gt;&lt;/p&gt;
</description></item><item><title>Microsoft news and tips &amp;raquo; Lifetime of a LINQ to SQL DataContext</title><link>http://blogs.msdn.com/dinesh.kulkarni/archive/2008/04/27/lifetime-of-a-linq-to-sql-datacontext.aspx#8434434</link><pubDate>Mon, 28 Apr 2008 08:34:47 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8434434</guid><dc:creator>Microsoft news and tips &amp;raquo; Lifetime of a LINQ to SQL DataContext</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://microsoftnews.askpcdoc.com/data-access/lifetime-of-a-linq-to-sql-datacontext"&gt;http://microsoftnews.askpcdoc.com/data-access/lifetime-of-a-linq-to-sql-datacontext&lt;/a&gt;&lt;/p&gt;
</description></item><item><title>re: Lifetime of a LINQ to SQL DataContext</title><link>http://blogs.msdn.com/dinesh.kulkarni/archive/2008/04/27/lifetime-of-a-linq-to-sql-datacontext.aspx#8435460</link><pubDate>Mon, 28 Apr 2008 17:26:46 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8435460</guid><dc:creator>rogerj</dc:creator><description>&lt;p&gt;Dinesh,&lt;/p&gt;
&lt;p&gt;Welcome back!&lt;/p&gt;
&lt;p&gt;--rj&lt;/p&gt;
</description></item><item><title>re: Lifetime of a LINQ to SQL DataContext</title><link>http://blogs.msdn.com/dinesh.kulkarni/archive/2008/04/27/lifetime-of-a-linq-to-sql-datacontext.aspx#8437708</link><pubDate>Tue, 29 Apr 2008 17:05:17 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8437708</guid><dc:creator>Tim Fischer</dc:creator><description>&lt;p&gt;&amp;gt;&amp;gt;Long-lived usage:DataContext does not itself overwrite the objects once you retrieve them through queries.&lt;/p&gt;
&lt;p&gt;How would i be able to load new values into an existing object in the context, then?&lt;/p&gt;
&lt;p&gt;Thank you&lt;/p&gt;
&lt;p&gt;Tim&lt;/p&gt;</description></item><item><title>re: Lifetime of a LINQ to SQL DataContext</title><link>http://blogs.msdn.com/dinesh.kulkarni/archive/2008/04/27/lifetime-of-a-linq-to-sql-datacontext.aspx#8459100</link><pubDate>Mon, 05 May 2008 03:41:23 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8459100</guid><dc:creator>Dinesh.Kulkarni</dc:creator><description>&lt;p&gt;Tim,&lt;/p&gt;
&lt;p&gt;I am not sure about the exact scenario you are looking for. You can always load new values into your objects. It is LINQ to SQL that is careful about not overwriting objects that belong to the user. &lt;/p&gt;
&lt;p&gt;The real question is how to get the new values to load them in your object. For that, you can also use a different DataContext instance (probably with same mapping and connection string). &lt;/p&gt;
&lt;p&gt;The notion of &amp;quot;Refresh()&amp;quot; is an intersting and a bit involved. I will likely post about it separately.&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Dinesh&lt;/p&gt;
</description></item><item><title>LINQ to SQL DataContext and Ent. Framework ObjectContext Lifetime Blog posts</title><link>http://blogs.msdn.com/dinesh.kulkarni/archive/2008/04/27/lifetime-of-a-linq-to-sql-datacontext.aspx#8519564</link><pubDate>Mon, 19 May 2008 22:42:08 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8519564</guid><dc:creator>Hot Topics</dc:creator><description>&lt;p&gt;Here&amp;amp;#39;s a collection of&amp;amp;#160; posts about the lifetime of these two related contexts. From Dinesh&lt;/p&gt;
</description></item><item><title>LINQ to SQL Tips 6: How to refresh given DataContext won't stomp on your objects </title><link>http://blogs.msdn.com/dinesh.kulkarni/archive/2008/04/27/lifetime-of-a-linq-to-sql-datacontext.aspx#8543153</link><pubDate>Sat, 24 May 2008 04:16:32 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8543153</guid><dc:creator>Dinesh's Cyberstation</dc:creator><description>&lt;p&gt;The DataContext is a rather careful beast. Once an object is retrieved, the DataContext will not stomp&lt;/p&gt;
</description></item><item><title>On LINQ to SQL, Concurrency and Timestamps</title><link>http://blogs.msdn.com/dinesh.kulkarni/archive/2008/04/27/lifetime-of-a-linq-to-sql-datacontext.aspx#8678868</link><pubDate>Wed, 02 Jul 2008 01:10:35 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8678868</guid><dc:creator>Mike Taulty's Blog</dc:creator><description>&lt;p&gt;I came across a bit of a glitch in using timestamps for checking concurrency violations in LINQ to SQL...&lt;/p&gt;
</description></item><item><title>LINQ to SQL Tips 9: Understanding DataContext's internal caching </title><link>http://blogs.msdn.com/dinesh.kulkarni/archive/2008/04/27/lifetime-of-a-linq-to-sql-datacontext.aspx#8680147</link><pubDate>Wed, 02 Jul 2008 08:24:16 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8680147</guid><dc:creator>Dinesh's Cyberstation</dc:creator><description>&lt;p&gt;Back to the &amp;quot;tips&amp;quot; series after a little break ... One common question I get is about caching of data&lt;/p&gt;
</description></item><item><title>Linq to SQL pitfalls</title><link>http://blogs.msdn.com/dinesh.kulkarni/archive/2008/04/27/lifetime-of-a-linq-to-sql-datacontext.aspx#9187746</link><pubDate>Tue, 09 Dec 2008 22:48:02 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9187746</guid><dc:creator>Willem Meints</dc:creator><description>&lt;p&gt;Currently I'm hard at work on a project where we use Linq to SQL quite a lot. It has led to some interesting&lt;/p&gt;
</description></item><item><title>Linq to Sql lifetime</title><link>http://blogs.msdn.com/dinesh.kulkarni/archive/2008/04/27/lifetime-of-a-linq-to-sql-datacontext.aspx#9482040</link><pubDate>Tue, 17 Mar 2009 00:59:29 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9482040</guid><dc:creator>Iga lahendus tekitab uusi probleeme ehk alati võib leida veel ühe bugi.</dc:creator><description>&lt;p&gt;&amp;#220;ks teemaisd, mis mind m&amp;#245;nda aega on Linq to SQL juures m&amp;#245;tisklema pannud, on selle lifetime ehk kui&lt;/p&gt;
</description></item></channel></rss>