<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>
			Comments at DigitallyCreated Blog (for blogs tagged: &quot;Entity Framework&quot;)
		</title>
		<link>http://www.digitallycreated.net/Blog/Tags/Entity%20Framework/CommentRss</link>
		<atom:link href="http://www.digitallycreated.net/Blog/Tags/Entity%20Framework/CommentRss" rel="self" type="application/rss+xml" />
		<description>
			A feed of all comments that are posted on any blog at DigitallyCreated that is tagged with &quot;Entity Framework&quot;.
		</description>
		<lastBuildDate>Sun, 05 Feb 2012 13:32:01 GMT</lastBuildDate>
		
		
			<item>
				<title>Unknown (myopenid) commented on &quot;Entity Framework, TransactionScope and MSDTC&quot;</title>
				<link>http://www.digitallycreated.net/Blog/48/entity-framework-transactionscope-and-msdtc#Comment62</link>
				<guid isPermaLink="false">DigitallyCreated Comment ID: 62</guid>
				<dc:creator>Unknown (myopenid)</dc:creator>
				<pubDate>Tue, 24 Jan 2012 15:07:44 GMT</pubDate>
				<description>
					Hi, I am writing a serial transaction and had some troubles.&lt;br/&gt;If I only execute one thread, it executes fast, no waiting.&lt;br/&gt;If I execute two or more threads, the first thread that complete takes too much time but subsequent threads are fast, why?&lt;br/&gt;&lt;br/&gt;If I run two process concurrently of this program, each process's first thread takes too much time to complete but subsequent are fast, is this normal?&lt;br/&gt;&lt;br/&gt;I am using sql express 2008&lt;br/&gt;&lt;br/&gt;tanks.&lt;br/&gt;&lt;br/&gt;class Program&lt;br/&gt;    {&lt;br/&gt;        int numero;&lt;br/&gt;&lt;br/&gt;        Program(int numero)&lt;br/&gt;        {&lt;br/&gt;            this.numero = numero;&lt;br/&gt;        }&lt;br/&gt;&lt;br/&gt;        static void Main(string[] args)&lt;br/&gt;        {&lt;br/&gt;            Console.WriteLine(&amp;quot;Puede presionar una tecla para salir en cualquier momento&amp;quot;);&lt;br/&gt;&lt;br/&gt;            for (int i = 0; i &amp;lt; 10; i++)&lt;br/&gt;            {&lt;br/&gt;                Program p = new Program(i + 1);&lt;br/&gt;                Thread t = new Thread(p.Ejecutar);&lt;br/&gt;                t.Start();&lt;br/&gt;            }&lt;br/&gt;&lt;br/&gt;            Console.ReadKey();&lt;br/&gt;        }&lt;br/&gt;&lt;br/&gt;        public void Ejecutar()&lt;br/&gt;        {  &lt;br/&gt;            bool esPosibleProseguir = true;&lt;br/&gt;            while (esPosibleProseguir)&lt;br/&gt;            {&lt;br/&gt;                Database1Entities cx = new Database1Entities();&lt;br/&gt;                TransactionOptions opts = new TransactionOptions();&lt;br/&gt;                opts.IsolationLevel = System.Transactions.IsolationLevel.Serializable;&lt;br/&gt;                System.Transactions.TransactionScope scope = new System.Transactions.TransactionScope(TransactionScopeOption.Required, opts);&lt;br/&gt;&lt;br/&gt;                try&lt;br/&gt;                {&lt;br/&gt;                    //var mayor = cx.Numeracion.First();&lt;br/&gt;                    //int nuevo = mayor.Numero + 1;&lt;br/&gt;                    cx.Connection.Open();&lt;br/&gt;&lt;br/&gt;                    int nuevo = cx.VistaNumero.First().Actual;&lt;br/&gt;&lt;br/&gt;                    var per = new Persona();&lt;br/&gt;                    per.Nombre = string.Format(&amp;quot;Persona-{0}&amp;quot;, nuevo);&lt;br/&gt;                    per.Ci = (1000 + nuevo).ToString();&lt;br/&gt;                    per.Numero = nuevo;&lt;br/&gt;                    cx.Persona.AddObject(per);&lt;br/&gt;&lt;br/&gt;                    /&lt;a href=&quot;/mayor.&quot;&gt;/mayor.&lt;/a&gt;Numero = nuevo;&lt;br/&gt;&lt;br/&gt;                    cx.SaveChanges();&lt;br/&gt;                    scope.Complete();&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;                    Console.WriteLine(&amp;quot;Hilo: {0}, Crea persona: {1}&amp;quot;, this.numero, nuevo);&lt;br/&gt;                    break;&lt;br/&gt;                }&lt;br/&gt;                catch (UpdateException ex1)&lt;br/&gt;                {&lt;br/&gt;                    esPosibleProseguir = true;&lt;br/&gt;                }&lt;br/&gt;                catch (TransactionAbortedException ex2)&lt;br/&gt;                {&lt;br/&gt;                    esPosibleProseguir = true;&lt;br/&gt;                }&lt;br/&gt;                catch (Exception ex)&lt;br/&gt;                {&lt;br/&gt;                    Console.WriteLine(&amp;quot;Hilo: {0}, Excepci&amp;#243;n: {1}, Mensaje: {2}&amp;quot;, this.numero, ex.GetType().Name, ex.Message);&lt;br/&gt;                    esPosibleProseguir = false;&lt;br/&gt;                }&lt;br/&gt;                finally&lt;br/&gt;                {&lt;br/&gt;                    DisponerObjeto(scope);&lt;br/&gt;                    DisponerObjeto(cx);&lt;br/&gt;                }&lt;br/&gt;            }&lt;br/&gt;        }&lt;br/&gt;&lt;br/&gt;        private void DisponerObjeto(IDisposable obj)&lt;br/&gt;        {&lt;br/&gt;            try&lt;br/&gt;            {&lt;br/&gt;                obj.Dispose();&lt;br/&gt;            }&lt;br/&gt;            catch (Exception ex)&lt;br/&gt;            {&lt;br/&gt;                Console.WriteLine(&amp;quot;Hilo: {0}, Excepci&amp;#243;n: {1}, Mensaje: {2}&amp;quot;, this.numero, ex.GetType().Name, ex.Message);&lt;br/&gt;            }&lt;br/&gt;        }&lt;br/&gt;    }
				</description>
			</item>
		
		
			<item>
				<title>bbqchickenrobot commented on &quot;Dynamic Queries in Entity Framework using Expression Trees&quot;</title>
				<link>http://www.digitallycreated.net/Blog/37/dynamic-queries-in-entity-framework-using-expression-trees#Comment49</link>
				<guid isPermaLink="false">DigitallyCreated Comment ID: 49</guid>
				<dc:creator>bbqchickenrobot</dc:creator>
				<pubDate>Mon, 08 Aug 2011 13:23:59 GMT</pubDate>
				<description>
					Ok, answered my own question... the answer is yes. You can create multiple where clauses and chain them. Another question would be how to do and clauses... 
				</description>
			</item>
		
		
			<item>
				<title>bbqchickenrobot commented on &quot;Dynamic Queries in Entity Framework using Expression Trees&quot;</title>
				<link>http://www.digitallycreated.net/Blog/37/dynamic-queries-in-entity-framework-using-expression-trees#Comment48</link>
				<guid isPermaLink="false">DigitallyCreated Comment ID: 48</guid>
				<dc:creator>bbqchickenrobot</dc:creator>
				<pubDate>Mon, 08 Aug 2011 13:09:41 GMT</pubDate>
				<description>
					So, let's say you have multiple parameters for the where clause... how would one go about implementing that? Is it as simple as creating two where expressions? Great blog post!
				</description>
			</item>
		
		
			<item>
				<title>Daniel Chambers commented on &quot;More Lessons from the LINQ Database Query Performance Land&quot;</title>
				<link>http://www.digitallycreated.net/Blog/68/more-lessons-from-the-linq-database-query-performance-land#Comment44</link>
				<guid isPermaLink="false">DigitallyCreated Comment ID: 44</guid>
				<dc:creator>Daniel Chambers</dc:creator>
				<pubDate>Thu, 21 Jul 2011 05:56:48 GMT</pubDate>
				<description>
					@Simon: Yes, convoluting your LINQ can degrade your maintainability, however, you might be able to improve the maintainability of the LINQ queries where you've done weird esoteric hacks (such as the ones discussed in the previous blog post I linked at the top of this one) by using an expression rewriter like the one I discussed here:&lt;br/&gt;&lt;br/&gt;&lt;a href=&quot;http://www.digitallycreated.net/Blog/66/sweeping-yucky-linq-queries-under-the-rug-with-expression-tree-rewriting&quot;&gt;http://www.digitallycreated.net/Blog/66/sweeping-yucky-linq-queries-under-the-rug-with-expression-tree-rewriting&lt;/a&gt;&lt;br/&gt;&lt;br/&gt;However, with respect to this blog post, I wouldn't consider the alternative query structure proposed here unmaintainable. In fact, it looks very much like SQL! Your only issue is communicating why the query has been written that way and not some other way, which a process of LINQ best practices education amongst your developers would help with.
				</description>
			</item>
		
		
			<item>
				<title>Simon Raik-Allen commented on &quot;More Lessons from the LINQ Database Query Performance Land&quot;</title>
				<link>http://www.digitallycreated.net/Blog/68/more-lessons-from-the-linq-database-query-performance-land#Comment43</link>
				<guid isPermaLink="false">DigitallyCreated Comment ID: 43</guid>
				<dc:creator>Simon Raik-Allen</dc:creator>
				<pubDate>Thu, 21 Jul 2011 01:41:46 GMT</pubDate>
				<description>
					On the flip side, convoluting your source to effect the output could degrade its maintainability. Not that that will always be the case, but its another thing to add to the balancing act. Damned if you do, damned if you don't :-)&lt;br/&gt;&lt;br/&gt;A Linq2Sql cheat sheet for these tips would be cool.&lt;br/&gt;&lt;br/&gt;Thanks, again.
				</description>
			</item>
		
		
			<item>
				<title>Daniel Chambers commented on &quot;More Lessons from the LINQ Database Query Performance Land&quot;</title>
				<link>http://www.digitallycreated.net/Blog/68/more-lessons-from-the-linq-database-query-performance-land#Comment42</link>
				<guid isPermaLink="false">DigitallyCreated Comment ID: 42</guid>
				<dc:creator>Daniel Chambers</dc:creator>
				<pubDate>Thu, 21 Jul 2011 00:09:13 GMT</pubDate>
				<description>
					@Simon: Short answer: it depends. :)&lt;br/&gt;&lt;br/&gt;Long answer: It depends (ha!) just how much pain LINQ is giving you, and how difficult it is to fit SQL into your application. Entity Framework lessens the pain as the LINQ query provider is better. L2S and EF both support compiled queries, so you can reduce the performance impact of using LINQ. At the end of the day, however, if you simply can't get LINQ to generate reasonably performing SQL (note that I didn't say &amp;quot;neat&amp;quot; SQL; who cares what it looks like so long as it performs acceptably) you've always got the option of hooking stored procedures into either L2S or EF. My experience with LINQ so far is that you can almost always get it to write decent SQL... with some tweaks to the LINQ. And as you discover and learn these tweaks, your productivity in LINQ increases. L2S is harder to get right, as it'll happily do stupid stuff like N+1 queries generated from your one LINQ query. EF won't do that, which helps immensely.
				</description>
			</item>
		
		
			<item>
				<title>Simon Raik-Allen commented on &quot;More Lessons from the LINQ Database Query Performance Land&quot;</title>
				<link>http://www.digitallycreated.net/Blog/68/more-lessons-from-the-linq-database-query-performance-land#Comment41</link>
				<guid isPermaLink="false">DigitallyCreated Comment ID: 41</guid>
				<dc:creator>Simon Raik-Allen</dc:creator>
				<pubDate>Wed, 20 Jul 2011 10:11:59 GMT</pubDate>
				<description>
					Nice post Daniel. I tend to find myself falling back to writing manual SQL for basically anything of importance (i.e., pulls lots of data or is called often). &lt;br/&gt;&lt;br/&gt;What is your guideline for when to intervene with hand-crafted queries?
				</description>
			</item>
		
		
			<item>
				<title>sib commented on &quot;Entity Framework, TransactionScope and MSDTC&quot;</title>
				<link>http://www.digitallycreated.net/Blog/48/entity-framework-transactionscope-and-msdtc#Comment36</link>
				<guid isPermaLink="false">DigitallyCreated Comment ID: 36</guid>
				<dc:creator>sib</dc:creator>
				<pubDate>Thu, 19 May 2011 09:11:07 GMT</pubDate>
				<description>
					Thanks a lot! You saved my day. The main reason we do not want to use MS DTC is because it can be turned off on client servers or can lack network permissions and deployment becomes nightmare!
				</description>
			</item>
		
		
		
	</channel>
</rss>

