﻿<?xml version="1.0" encoding="utf-8"?><rss version="2.0"><channel><title>Ayende @ Rahien</title><link>http://ayende.com/blog/</link><description>Ayende @ Rahien</description><copyright>Copyright (C) Ayende Rahien  2004 - 2012 (c) 2013</copyright><ttl>60</ttl><item><title>Uber Prof 2.0 is OUT!</title><description>&lt;p&gt;Exactly 4 years after the 1.0 release of Uber Prof, we have the 2.0 release for Uber Prof.&lt;/p&gt; &lt;p&gt;You can find it here: &lt;a href="http://hibernatingrhinos.com/products/"&gt;http://hibernatingrhinos.com/products/&lt;/a&gt;&lt;/p&gt; &lt;p&gt;New features include production and cloud profiling, performance improvement and better error detection &amp;amp; guidance.&lt;/p&gt;</description><link>http://ayende.com/blog/160577/uber-prof-2-0-is-out?key=98e152f5-2a43-41d9-b560-93304ce79061</link><guid>http://ayende.com/blog/160577/uber-prof-2-0-is-out?key=98e152f5-2a43-41d9-b560-93304ce79061</guid><pubDate>Tue, 01 Jan 2013 10:00:00 GMT</pubDate></item><item><title>Goodbye, 2012: Our end of year discount starts now!</title><description>&lt;p&gt;Well, as the year draws to a close, it is that time again, I got older, apparently. Yesterday marked my 31th trip around the sun.&lt;/p&gt; &lt;p&gt;To celebrate, I decided to give the first 31 people a &lt;strong&gt;31% discount&lt;/strong&gt; for all of our products.&lt;/p&gt; &lt;p&gt;This offer applies to:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;&lt;a href="http://ravendb.net/licensing"&gt;Raven DB&lt;/a&gt; (Standard edition)&lt;/li&gt; &lt;li&gt;&lt;a href="http://hibernatingrhinos.com/products/nhprof/buy"&gt;NHibernate Profiler&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="http://hibernatingrhinos.com/products/efprof/buy"&gt;Entity Framework Profiler&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="http://hibernatingrhinos.com/products/l2sprof/buy"&gt;Linq to SQL Profiler&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="http://hibernatingrhinos.com/products/llblgenprof/buy"&gt;LLBLGen Profiler&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;This also applies to our support &amp;amp; consulting services.&lt;/p&gt; &lt;p&gt;All you have to do is to use the following coupon code: goodbye-2012&lt;/p&gt; &lt;p&gt;Enjoy the end of the year, and happy holidays.&lt;/p&gt;</description><link>http://ayende.com/blog/160385/goodbye-2012-our-end-of-year-discount-starts-now?key=3cc53059-f0aa-48ca-ba7f-9131593f0f0a</link><guid>http://ayende.com/blog/160385/goodbye-2012-our-end-of-year-discount-starts-now?key=3cc53059-f0aa-48ca-ba7f-9131593f0f0a</guid><pubDate>Fri, 21 Dec 2012 05:02:00 GMT</pubDate></item><item><title>Production Cloud Profiling With Uber Prof</title><description>&lt;p&gt;With Uber Prof 2.0 (&lt;a href="http://nhprof.com/"&gt;NHibernate Profiler&lt;/a&gt;, &lt;a href="http://efprof.com/"&gt;Entity Framework Profiler&lt;/a&gt;, &lt;a href="http://l2sprof.com/"&gt;Linq to SQL Profiler&lt;/a&gt;, &lt;a href="http://llblgenprof.com/"&gt;LLBLGen Profiler&lt;/a&gt;) we are going to bring you a new era of goodness.&lt;/p&gt; &lt;p&gt;In 1.0, we gave you a LOT of goodness for the development stage of building your application, but now we are able to take it a few steps further. Uber Prof 2.0 supports production profiling, which means that you can run it &lt;em&gt;in production&lt;/em&gt; and see what is going on &lt;em&gt;in your application now!&lt;/em&gt;&lt;/p&gt; &lt;p&gt;To make things even more interesting, we have also done a lot of work to make sure that this works on the cloud as well. For example, go ahead and look at this site: &lt;a title="http://efprof.cloudapp.net/" href="http://efprof.cloudapp.net/"&gt;http://efprof.cloudapp.net/&lt;/a&gt;&lt;/p&gt; &lt;p&gt;This is a live application, that doesn’t really do anything special, I’ll admit. But the kicker is when you go to this URL: &lt;a title="http://efprof.cloudapp.net/profiler/profiler.html" href="http://efprof.cloudapp.net/profiler/profiler.html"&gt;http://efprof.cloudapp.net/profiler/profiler.html&lt;/a&gt;&lt;/p&gt; &lt;p&gt;&lt;a href="http://ayende.com/blog/Images/Windows-Live-Writer/Cloud-Profiling-With-Uber-Prof_8519/image_2.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://ayende.com/blog/Images/Windows-Live-Writer/Cloud-Profiling-With-Uber-Prof_8519/image_thumb.png" width="944" height="315"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;This is EF Prof, running on the cloud, and giving you the results that you want, &lt;em&gt;live&lt;/em&gt;. You can read all about this feature and &lt;a href="http://blog.hibernatingrhinos.com/12769/uber-prof-production-profilingndash-profiling-production-application-on-azure?key=6fc682a1295942c592ad8f11b18ec185"&gt;how to enable it here&lt;/a&gt;, but I am sure that you can see the implications. &lt;/p&gt;</description><link>http://ayende.com/blog/160321/production-cloud-profiling-with-uber-prof?key=7504912e-62b1-4a6d-92a6-becb03303035</link><guid>http://ayende.com/blog/160321/production-cloud-profiling-with-uber-prof?key=7504912e-62b1-4a6d-92a6-becb03303035</guid><pubDate>Tue, 18 Dec 2012 10:00:00 GMT</pubDate></item><item><title>Uber Prof V2.0 is now in Public Beta</title><description>&lt;p&gt;Well, we worked quite a bit on that, but the Uber Prof (NHibernate Profiler, Entity Framework Profiler, Linq to SQL Profiler, etc) version 2.0 are now out for public beta.&lt;/p&gt; &lt;p&gt;We made a &lt;em&gt;lot&lt;/em&gt; of improvements. Including performance, stability and responsiveness, but probably the most important thing from the user perspective is that we now support running the profiler in production, and even on the cloud.&lt;/p&gt; &lt;p&gt;We will have the full listing of all the new goodies up on the company site soon, including detailed instructions on how to enable production profiling and on cloud profiling, but I just couldn’t wait to break the news to you.&lt;/p&gt; &lt;p&gt;In fact, along with V2.0 of the profilers, we have a brand new site for our company, which you can check here: &lt;a href="http://hibernatingrhinos.com/"&gt;http://hibernatingrhinos.com/&lt;/a&gt;. &lt;/p&gt; &lt;p&gt;To celebrate the fact that we are going on beta, we also offer a &lt;strong&gt;20%&lt;/strong&gt; discount for the duration of the beta.&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;Nitpicker corner, please remember that this &lt;em&gt;is&lt;/em&gt; a beta, there are bound to be problems, and we will fix them as soon as we can.&lt;/p&gt;&lt;/blockquote&gt;</description><link>http://ayende.com/blog/159425/uber-prof-v2-0-is-now-in-public-beta?key=90fbb3f4-d674-4f99-a280-aec8792e20cb</link><guid>http://ayende.com/blog/159425/uber-prof-v2-0-is-now-in-public-beta?key=90fbb3f4-d674-4f99-a280-aec8792e20cb</guid><pubDate>Mon, 22 Oct 2012 06:25:00 GMT</pubDate></item><item><title>Über Profiler v2.0–Private Beta is open</title><description>&lt;p&gt;Well, it took a while, but the next version of the NHibernate Profiler is ready to go to a private beta.&lt;/p&gt; &lt;p&gt;We go to private beta before the product is done, because we want to get as much early feedback as we can.&lt;/p&gt; &lt;p&gt;We have 10 spots for NHibernate Profiler v2.0 and 10 spots for Entity Framework Profiler v2.0.&lt;/p&gt; &lt;p&gt;If you are interested, please send me an email about this.&lt;/p&gt;</description><link>http://ayende.com/blog/157985/uber-profiler-v2-0-private-beta-is-open?key=addf4b10-01f6-4b74-8f8f-c643f83b0d43</link><guid>http://ayende.com/blog/157985/uber-profiler-v2-0-private-beta-is-open?key=addf4b10-01f6-4b74-8f8f-c643f83b0d43</guid><pubDate>Thu, 16 Aug 2012 09:00:00 GMT</pubDate></item><item><title>An Entity Framework Profiler user story</title><description>&lt;p&gt;One of the things that I really love about build things like the profilers and RavenDB is that it gives me the chance to really spread a lot of my experience in codified form. Occasionally, we get customer feedback to that effect, and I thought that I would share this one with you.  &lt;p&gt;Jeremy Holt have been using the &lt;a href="http://efprof.com"&gt;Entity Framework Profiler&lt;/a&gt; and has the following to say: &lt;blockquote&gt; &lt;p&gt;The biggest issue it has highlighted for me is the question of the Context being created on different threads (the N+1 was easy to get my head around and resolve). The problem is the difficulty in finding definitive examples of how/when the Context should be created. (Also found my unbound queries – thanks for that!!) &lt;p&gt;It was working great (except for a couple of threading issues J) until I ran EFProf. I love the “page of shame” in EFProf – I think you called it “query analysis alerts” or something pompous like that – may I suggest you rename it to “errors dumb programmers make” J&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;I don’t think that this will be renamed, but this does point out something very important. What we are doing with the profilers is much more than simply show you what your application is doing. We are actually analyzing this data through a complex set of rules in order to find common pitfalls. In Jeremy’s case, the common ones were cross thread usage and Select N+1. &lt;p&gt;And by highlighting those issues, the profiler make it easy to do so. More so, it make you feel &lt;em&gt;good&lt;/em&gt; about doing this, in a way that you wouldn’t get from standard analytics tools. &lt;p&gt;By having thresholds that you can visibly see and avoid, you get to create better software.&lt;/p&gt;</description><link>http://ayende.com/blog/156001/an-entity-framework-profiler-user-story?key=362194c3-0d1d-4207-80c8-213ec711f915</link><guid>http://ayende.com/blog/156001/an-entity-framework-profiler-user-story?key=362194c3-0d1d-4207-80c8-213ec711f915</guid><pubDate>Tue, 05 Jun 2012 09:00:00 GMT</pubDate></item><item><title>Application analysis: Northwind.NET</title><description>&lt;p&gt;For an article I am writing, I wanted to compare a RavenDB model to a relational model, and I stumbled upon the following &lt;a href="http://northwind.codeplex.com/"&gt;Northwind.NET project&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;I plugged in the &lt;a href="http://efprof.com"&gt;Entity Framework Profiler&lt;/a&gt; and set out to watch what was going on. To be truthful, I expected it to be bad, but I honestly did &lt;em&gt;not&lt;/em&gt; expect what I got. Here is a question, how many queries does it take to render the following screen?&lt;/p&gt; &lt;p&gt;&lt;a href="http://ayende.com/blog/Images/Windows-Live-Writer/Application-analysis_B141/image_2.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://ayende.com/blog/Images/Windows-Live-Writer/Application-analysis_B141/image_thumb.png" width="940" height="693"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;The answer, believe it or no, is 17:&lt;/p&gt; &lt;p&gt;&lt;a href="http://ayende.com/blog/Images/Windows-Live-Writer/Application-analysis_B141/image_4.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://ayende.com/blog/Images/Windows-Live-Writer/Application-analysis_B141/image_thumb_1.png" width="771" height="409"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;You might have noticed that most of the queries look quite similar, and indeed, they &lt;em&gt;are&lt;/em&gt;. We are talking about 16(!) identical queries:&lt;/p&gt; &lt;blockquote&gt;&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;SELECT&lt;/span&gt; [Extent1].[ID]           &lt;span class="kwrd"&gt;AS&lt;/span&gt; [ID],
       [Extent1].[Name]         &lt;span class="kwrd"&gt;AS&lt;/span&gt; [Name],
       [Extent1].[Description]  &lt;span class="kwrd"&gt;AS&lt;/span&gt; [Description],
       [Extent1].[Picture]      &lt;span class="kwrd"&gt;AS&lt;/span&gt; [Picture],
       [Extent1].[RowTimeStamp] &lt;span class="kwrd"&gt;AS&lt;/span&gt; [RowTimeStamp]
&lt;span class="kwrd"&gt;FROM&lt;/span&gt;   [dbo].[Category] &lt;span class="kwrd"&gt;AS&lt;/span&gt; [Extent1]&lt;/pre&gt;
&lt;style type="text/css"&gt;.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }
&lt;/style&gt;
&lt;/blockquote&gt;
&lt;p&gt;Looking at the stack trace for one of those queries led me to:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://ayende.com/blog/Images/Windows-Live-Writer/Application-analysis_B141/image_6.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://ayende.com/blog/Images/Windows-Live-Writer/Application-analysis_B141/image_thumb_2.png" width="1014" height="352"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;And to this piece of code:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;a href="http://ayende.com/blog/Images/Windows-Live-Writer/Application-analysis_B141/image_8.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://ayende.com/blog/Images/Windows-Live-Writer/Application-analysis_B141/image_thumb_3.png" width="758" height="371"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;You might note that dynamic is used there, for what reason, I cannot even guess. Just to check, I added a ToArray() to the result of GetEntitySet, and the number of queries dropped from 17 to 2, which is more reasonable. The problem was that we passed an IQueryable to the data binding engine, which ended up evaluating the query multiple times.&lt;/p&gt;
&lt;p&gt;And &lt;a href="http://efprof.com"&gt;EF Prof&lt;/a&gt; actually warns about that, too:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://ayende.com/blog/Images/Windows-Live-Writer/Application-analysis_B141/image_10.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://ayende.com/blog/Images/Windows-Live-Writer/Application-analysis_B141/image_thumb_4.png" width="763" height="120"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;At any rate, I am afraid that this project suffer from similar issues all around, it is actually too bad to serve as the bad example that I intended it to be.&lt;/p&gt;</description><link>http://ayende.com/blog/152705/application-analysis-northwind-net?key=50a77d7b-0d0f-4b53-9305-eba261b563c1</link><guid>http://ayende.com/blog/152705/application-analysis-northwind-net?key=50a77d7b-0d0f-4b53-9305-eba261b563c1</guid><pubDate>Fri, 30 Dec 2011 10:00:00 GMT</pubDate></item><item><title>Gilad Shalit is back</title><description>&lt;p&gt;I don’t usually do posts about current events, but &lt;a href="http://www.ynetnews.com/articles/0,7340,L-4136451,00.html"&gt;this one is huge&lt;/a&gt;. &lt;/p&gt; &lt;p&gt;To celebrate the event, you can use the following coupon code: SLT-45K2D4692G to get 19.41% discount (Gilad was captive for 1,941 days) for all our profilers:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;&lt;a href="http://nhprof.com/"&gt;NHibernate Profiler&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="http://efprof.com/"&gt;Entity Framework Profiler&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="http://l2sprof.com/"&gt;Linq to SQL Profiler&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="http://llblgenprof.com/"&gt;LLBLGen Profiler&lt;/a&gt; &lt;/li&gt; &lt;li&gt;&lt;a href="http://hibernateprofiler.com/"&gt;Hibernate Profiler&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;Hell, even our &lt;a href="http://nhprof.com/commercialsupport"&gt;commercial support for NHibernate&lt;/a&gt; is participating.&lt;/p&gt; &lt;p&gt;Please note that any political comment to this post that I don’t agree with will be deleted.&lt;/p&gt;</description><link>http://ayende.com/blog/130049/gilad-shalit-is-back?key=b8b09d35-b65b-4925-9046-a6315d3899aa</link><guid>http://ayende.com/blog/130049/gilad-shalit-is-back?key=b8b09d35-b65b-4925-9046-a6315d3899aa</guid><pubDate>Tue, 18 Oct 2011 10:00:00 GMT</pubDate></item><item><title>Entity Framework 4.1 Update 1, Backward Compatibility and Microsoft</title><description>&lt;p&gt;One of the things that you keep hearing about Microsoft products is how much time and effort is dedicated to ensuring Backward Compatibility. I have had a lot of arguments with Microsoft people about certain design decisions that they have made, and usually the argument ended up with “We have to do it this was to ensure Backward Compatibility”. &lt;/p&gt; &lt;p&gt;That sucked, but at least I could sleep soundly, knowing that if I had software running on version X of Microsoft, I could at least be pretty sure that it would work in X+1.&lt;/p&gt; &lt;p&gt;Until Entity Framework 4.1 Update 1 shipped, that is. &lt;a href="http://weblogs.asp.net/fbouma/archive/2011/07/28/entity-framework-v4-1-update-1-the-kill-the-tool-eco-system-version.aspx"&gt;Frans Bouma has done a great job in describing what the problem actually is&lt;/a&gt;, including going all the way and actually submitting a patch with the code required to fix this issue.&lt;/p&gt; &lt;p&gt;But basically, starting with Entity Framework 4.1 Update 1 (the issue also appears in Entity Framework 4.2 CTP, but I don’t care about this much now), you can’t use generic providers with Entity Framework. Just to explain, generic providers is pretty much the one way that you can integrate with Entity Framework if you want to write a profiler or a cacher or a… you get the point.&lt;/p&gt; &lt;p&gt;Looking at the code, it is pretty obvious that this is &lt;em&gt;not&lt;/em&gt; intentional, but just someone deciding to implement a method without considering the full ramifications. When I found out about the bug, I tried figuring out a way to resolve it, but the only work around would require me to provide a different assembly for each provider that I wanted to support (and there are dozens that we support on EF 4.0 and EF 3.5 right now).&lt;/p&gt; &lt;p&gt;We have currently &lt;strong&gt;implemented a work around for SQL Server only&lt;/strong&gt;, but if you want to use Entity Framework Profiler with Entity Framework 4.1 Update 1 and a database other than SQL Server, we would have to create a special build for your scenario, rather than have you use the generic provider method, which have worked so far. &lt;/p&gt; &lt;p&gt;Remember the beginning of this post? How I said that Backward Compatibility is something that Microsoft is taking so seriously? &lt;/p&gt; &lt;p&gt;Naturally I felt that this (a bug that impacts anyone who extends Entity Framework in such a drastic way) is an important issue to raise with Microsoft. So I contacted the team with my finding, and the response that I got was basically: Use the old version if you want this supported.&lt;/p&gt; &lt;p&gt;What I &lt;em&gt;didn’t &lt;/em&gt;get was:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;Addressing the issue of a breaking change of this magnitude that isn’t even on a major release, it is an &lt;em&gt;update to a minor release.&lt;/em&gt;&lt;/li&gt; &lt;li&gt;Whatever they are even going to fix it, and when this is going to be out.&lt;/li&gt; &lt;li&gt;Whatever the next version (4.2 CTP also have this bug) is going to carry on this issue or not.&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;I find this unacceptable. The fact that there is a problem with a CTP is annoying, but not that important. The fact that a &lt;em&gt;fully release package&lt;/em&gt; has this backward compatibility issue is horrible.  &lt;p&gt;What makes it even worse is the fact that this is an update to a minor version, people excepts this to be a safe upgrade, not something that requires full testing. And &lt;em&gt;anyone&lt;/em&gt; who is going to be running Update-Package in VS is going to hit this problem, and Update-Package is something that people do very often. And suddenly, Entity Framework Profiler can no longer work.  &lt;p&gt;Considering the costs that the entire .NET community has to bear in order for Microsoft to preserve backward compatibility, I am deeply disappointed that when I actually need this backward compatibility.  &lt;p&gt;This is from the same guys that refused (for five years!) to fix &lt;a href="https://connect.microsoft.com/VisualStudio/feedback/details/93559/typeconverter-for-value-types-such-as-int-bool-short-etc-return-true-to-isvalid-even-if-the-value-is-not-valid"&gt;this bug&lt;/a&gt;: &lt;blockquote&gt;&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;new&lt;/span&gt; System.ComponentModel.Int32Converter().IsValid(&lt;span class="str"&gt;"yellow"&lt;/span&gt;) == true&lt;/pre&gt;
&lt;style type="text/css"&gt;.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }
&lt;/style&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;&lt;/blockquote&gt;
&lt;p&gt;Because, and I quote:
&lt;blockquote&gt;
&lt;p&gt;We do not have the luxury of making that risky assumption that people will not be affected by the potential change. I know this can be frustrating for you as it is for us. Thanks for your understanding in this matter.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;Let me put this to you in perspective, anyone who is using EF Prof is likely to (almost by chance) to get hit by that. When this happens, our only option is to tell them to switch back a version? 
&lt;p&gt;That makes &lt;em&gt;us &lt;/em&gt;look very bad, &lt;em&gt;regardless&lt;/em&gt; of what is the actual reason for that. That means that I am having to undermine my users' trust in my product. "He isn't supporting 4.1, and he might not support 4.2, so we probably can't buy his product, because we want to have the newest version". 
&lt;p&gt;This is very upsetting. Not so much about the actual bug, those happen, and I can easily imagine the guy writing the code making assumptions that turn out to be false. Heavens know that I have done the same many times before. I don’t even worry too much about this having escaped the famous Microsoft Testing Cycle. 
&lt;p&gt;What (to be frank) pisses me off is that the response that we got from Microsoft for this was that they aren’t going to fix this. That the only choice that I have it to tell people to downgrade if they want to use my product (with all the implications that has for my product).&lt;/p&gt;
&lt;p&gt;&lt;img style="border-bottom-style: none; border-left-style: none; border-top-style: none; border-right-style: none" class="wlEmoticon wlEmoticon-sadsmile" alt="Sad smile" src="http://ayende.com/blog/Images/Windows-Live-Writer/Entity-Framework-4.1_B4A0/wlEmoticon-sadsmile_2.png"&gt;&lt;/p&gt;</description><link>http://ayende.com/blog/75777/entity-framework-4-1-update-1-backward-compatibility-and-microsoft?key=72c586ff-448c-420b-bdc4-214f3a172040</link><guid>http://ayende.com/blog/75777/entity-framework-4-1-update-1-backward-compatibility-and-microsoft?key=72c586ff-448c-420b-bdc4-214f3a172040</guid><pubDate>Fri, 05 Aug 2011 09:00:00 GMT</pubDate></item><item><title>What is next for the profilers?</title><description>&lt;p&gt;We have been working on the profilers (&lt;a href="http://nhprof.com/"&gt;NHibernate Profiler&lt;/a&gt;, &lt;a href="http://efprof.com/"&gt;Entity Framework Profiler&lt;/a&gt;, &lt;a href="http://l2sprof.com/"&gt;Linq to SQL Profiler&lt;/a&gt;, &lt;a href="http://llblgenprof.com/"&gt;LLBLGen Profiler&lt;/a&gt; and &lt;a href="http://hibernateprofiler.com"&gt;Hibernate Profiler&lt;/a&gt;) for close to three years now. And we have been running always as 1.x, so we didn’t have a major release (although we have continual releases, we currently have close to 900 drops of the 1.x version).&lt;/p&gt; &lt;p&gt;The question now becomes, what is going to happen in the next version of the profiler?&lt;/p&gt; &lt;ul&gt; &lt;li&gt;Production Profiling, the ability to setup your application so that you can connect to your production application and see what is going on &lt;em&gt;right now&lt;/em&gt;. &lt;/li&gt; &lt;li&gt;Error Analysis, the ability to provide you with additional insight and common solution to recurring problems.&lt;/li&gt; &lt;li&gt;Global Query Analysis, the ability to take all of your queries, look at their query plans and show your potential issues.&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;Those are the big ones, we have a few others, and a surprise in store &lt;img style="border-bottom-style: none; border-left-style: none; border-top-style: none; border-right-style: none" class="wlEmoticon wlEmoticon-smile" alt="Smile" src="http://ayende.com/blog/Images/Windows-Live-Writer/What-is-next-for-the-profilers_868C/wlEmoticon-smile_2.png"&gt;&lt;/p&gt; &lt;p&gt;What would you want to see in the next version of the profiler?&lt;/p&gt;</description><link>http://ayende.com/blog/11265/what-is-next-for-the-profilers?key=98ae56ef-3200-41b0-beec-1c206cbe1608</link><guid>http://ayende.com/blog/11265/what-is-next-for-the-profilers?key=98ae56ef-3200-41b0-beec-1c206cbe1608</guid><pubDate>Thu, 02 Jun 2011 09:00:00 GMT</pubDate></item><item><title>Uber Prof &amp; NuGet</title><description>&lt;p&gt;Fitzchak has all the details in our &lt;a href="http://blogs.hibernatingrhinos.com/archive/2011/03/31/nuget-packages-and-an-example-use-of-the-profiler.aspx"&gt;company blog&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;&lt;img alt="NugetPackages" src="http://blogs.hibernatingrhinos.com/images/blogs_hibernatingrhinos_com/Windows-Live-Writer/33b8e30a3166_9ED0/NugetPackages_thumb_1.png" /&gt;&lt;/p&gt;</description><link>http://ayende.com/blog/4799/uber-prof-nuget?key=e4deb5ce-de52-4c43-89ba-2c3f410d2801</link><guid>http://ayende.com/blog/4799/uber-prof-nuget?key=e4deb5ce-de52-4c43-89ba-2c3f410d2801</guid><pubDate>Fri, 01 Apr 2011 11:00:00 GMT</pubDate></item><item><title>New Profiler Feature: Avoid Writes from Multiple Sessions In The Same Request</title><description>&lt;p&gt;Because I keep getting asked, this feature is available for the following profilers:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://nhprof.com/"&gt;NHibernate Profiler&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://efprof.com/"&gt;Entity Framework Profiler&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://l2sprof.com/"&gt;Linq to SQL Profiler&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://llblgenprof.com/"&gt;LLBLGen Profiler&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://hibernateprofiler.com/"&gt;Hibernate Profiler&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;This new feature detects a very interesting bad practice, write to the database from multiple session in the same web request.&lt;/p&gt;  &lt;p&gt;For example, consider the following code:&lt;/p&gt;  &lt;blockquote&gt;   &lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; SaveAccount(Account account)
{
    &lt;span class="kwrd"&gt;using&lt;/span&gt;(var session = sessionFactory.OpenSession())
    &lt;span class="kwrd"&gt;using&lt;/span&gt;(session.BeginTransaction())
    {
           session.SaveOrUpdate(account);
           session.Transaction.Commit();    
    }
}&lt;/pre&gt;

  &lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; Account GetAccount(&lt;span class="kwrd"&gt;int&lt;/span&gt; id)
{
    &lt;span class="kwrd"&gt;using&lt;/span&gt;(var session = sessionFactory.OpenSession())
    {
        &lt;span class="kwrd"&gt;return&lt;/span&gt; session.Get&amp;lt;Account&amp;gt;(id);
    }
}&lt;/pre&gt;
  &lt;style type="text/css"&gt;&lt;![CDATA[
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }]]&gt;&lt;/style&gt;&lt;style type="text/css"&gt;&lt;![CDATA[
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }]]&gt;&lt;/style&gt;&lt;/blockquote&gt;

&lt;p&gt;It is bad for several reasons, micro managing the session is just one of them, but the worst part is yet to come…&lt;/p&gt;

&lt;blockquote&gt;
  &lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; MakePayment(&lt;span class="kwrd"&gt;int&lt;/span&gt; fromAccount, &lt;span class="kwrd"&gt;int&lt;/span&gt; toAccount, &lt;span class="kwrd"&gt;decimal&lt;/span&gt; ammount)
{
    var from = Dao.GetAccount(fromAccount);
    var to = Dao.GetAccount(toAccount);
    from.Total -= amount;
    to.Total += amount;
    Dao.SaveAccount(from);
    Dao.SaveAccount(to);
}&lt;/pre&gt;
  &lt;style type="text/css"&gt;&lt;![CDATA[
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }]]&gt;&lt;/style&gt;&lt;/blockquote&gt;

&lt;p&gt;Do you see the error here? There are actually several, let me count them:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;We are using 4 different connections to the database in a single method.&lt;/li&gt;

  &lt;li&gt;&lt;strong&gt;We don’t have transactional safety!!!!&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Think about it, if the server crashed between the fifth and sixth lines of this method, where would we be? &lt;/p&gt;

&lt;p&gt;We would be in that wonderful land where money disappear into thin air and we stare at that lovely lawsuit folder and then jump from a high window to a stormy sea.&lt;/p&gt;

&lt;p&gt;Or, of course, you could use the profiler, which will tell you that you are doing something which should be avoided:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://ayende.com/Blog/images/ayende_com/Blog/Windows-Live-Writer/New-Alert-Multiple-Write-Sessions-In-The_C8D8/image_2.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://ayende.com/Blog/images/ayende_com/Blog/Windows-Live-Writer/New-Alert-Multiple-Write-Sessions-In-The_C8D8/image_thumb.png" width="775" height="110" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Isn’t that better than swimming with the sharks?&lt;/p&gt;</description><link>http://ayende.com/blog/4775/new-profiler-feature-avoid-writes-from-multiple-sessions-in-the-same-request?key=7f102633-ec3a-497f-b84f-8c191dab2292</link><guid>http://ayende.com/blog/4775/new-profiler-feature-avoid-writes-from-multiple-sessions-in-the-same-request?key=7f102633-ec3a-497f-b84f-8c191dab2292</guid><pubDate>Tue, 01 Mar 2011 12:26:00 GMT</pubDate></item><item><title>New Uber Prof Feature: Too Many Database Calls In The Same Request</title><description>&lt;p&gt;&lt;font size="3"&gt;Recently, we added a way to track alerts across all the sessions the request. This alert will detect whenever you are making too many database calls in the same request.&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;But wait, don’t we already have that?&lt;/p&gt;  &lt;p&gt;Yes, we do, but that was limited to the scope of one session. there is a very large set of codebases where the usage of OR/Ms is… suboptimal (in other words, they could take the most advantage of the profiler abilities to detect issues and suggest solutions to them), but because of the way they are structured, they weren’t previously detected.&lt;/p&gt;  &lt;p&gt;&lt;font size="3"&gt;What is the difference between a session and a request? &lt;/font&gt;&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;font size="3"&gt;Note: I am using NHibernate terms here, but naturally this feature is shared among all profiler:&lt;/font&gt;&lt;/p&gt;    &lt;ul&gt;     &lt;li&gt;&lt;a href="http://nhprof.com/"&gt;NHibernate Profiler&lt;/a&gt;&lt;/li&gt;      &lt;li&gt;&lt;a href="http://efprof.com/"&gt;Entity Framework Profiler&lt;/a&gt;&lt;/li&gt;      &lt;li&gt;&lt;a href="http://l2sprof.com/"&gt;Linq to SQL Profiler&lt;/a&gt;&lt;/li&gt;      &lt;li&gt;&lt;a href="http://llblgenprof.com/"&gt;LLBLGen Profiler&lt;/a&gt;&lt;/li&gt;      &lt;li&gt;&lt;a href="http://hibernateprofiler.com/"&gt;Hibernate Profiler&lt;/a&gt;&lt;/li&gt;   &lt;/ul&gt; &lt;/blockquote&gt;  &lt;p&gt;&lt;font size="3"&gt;A session is the NHibernate session (or the data/object context in linq to sql / entity framework), and the request is the HTTP request or the WCF operation. If you had code such as the following:&lt;/font&gt;&lt;/p&gt;  &lt;blockquote&gt;   &lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; T GetEntity&amp;lt;T&amp;gt;(&lt;span class="kwrd"&gt;int&lt;/span&gt; id)
{
    &lt;span class="kwrd"&gt;using&lt;/span&gt; (var session = sessionFactory.OpenSession())
    {
         &lt;span class="kwrd"&gt;return&lt;/span&gt; session.Get&amp;lt;T&amp;gt;(id);
    }
}&lt;/pre&gt;
  &lt;style type="text/css"&gt;&lt;![CDATA[
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }]]&gt;&lt;/style&gt;&lt;/blockquote&gt;

&lt;p&gt;This code is bad, it micro manages the session, it uses too many connections to the database, it … well, you get the point. The problem is that code that uses this code:&lt;/p&gt;

&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; IEnumerable&amp;lt;Friends&amp;gt; GetFriends(&lt;span class="kwrd"&gt;int&lt;/span&gt;[] friends)
{
   var results = &lt;span class="kwrd"&gt;new&lt;/span&gt; List&amp;lt;Friends&amp;gt;();
   &lt;span class="kwrd"&gt;foreach&lt;/span&gt;(var id &lt;span class="kwrd"&gt;in&lt;/span&gt; friends)
       results.Add(GetEnttiy&amp;lt;Friend&amp;gt;(id));

   &lt;span class="kwrd"&gt;return&lt;/span&gt; results;
}&lt;/pre&gt;
&lt;style type="text/css"&gt;&lt;![CDATA[
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }]]&gt;&lt;/style&gt;

&lt;p&gt;The code above would look like the following in the profiler:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://ayende.com/Blog/images/ayende_com/Blog/Windows-Live-Writer/New-Alert-Too-Many-Database-Calls-In-The_C8E2/Image1.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="Image1" border="0" alt="Image1" src="http://ayende.com/Blog/images/ayende_com/Blog/Windows-Live-Writer/New-Alert-Too-Many-Database-Calls-In-The_C8E2/Image1_thumb.png" width="251" height="400" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As you can see, each call is in a separate session, and previously, we wouldn’t have been able to detect that you have too many calls (because each call is a separate session).&lt;/p&gt;

&lt;p&gt;Now, however, we will alert the user with a too many database calls in the same request alerts. &lt;/p&gt;

&lt;p&gt;&lt;a href="http://ayende.com/Blog/images/ayende_com/Blog/Windows-Live-Writer/New-Alert-Too-Many-Database-Calls-In-The_C8E2/Image2.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="Image2" border="0" alt="Image2" src="http://ayende.com/Blog/images/ayende_com/Blog/Windows-Live-Writer/New-Alert-Too-Many-Database-Calls-In-The_C8E2/Image2_thumb.png" width="699" height="317" /&gt;&lt;/a&gt;&lt;/p&gt;</description><link>http://ayende.com/blog/4774/new-uber-prof-feature-too-many-database-calls-in-the-same-request?key=5fe23059-c0d9-4990-8c16-0372c0ee5bac</link><guid>http://ayende.com/blog/4774/new-uber-prof-feature-too-many-database-calls-in-the-same-request?key=5fe23059-c0d9-4990-8c16-0372c0ee5bac</guid><pubDate>Mon, 28 Feb 2011 12:15:00 GMT</pubDate></item><item><title>New Uber Prof Concept: Cross Session Alerts</title><description>&lt;p&gt;We have recently been doing some work on Uber Prof, mostly in the sense of a code review, and I wanted to demonstrate how easy it was to add a new feature. The problem is that we couldn’t really think of a nice feature to add that we didn’t already have. &lt;/p&gt;  &lt;p&gt;Then we started thinking about features that aren’t there and that there wasn’t anything in Uber Prof to enable, and we reached the conclusion that one limitation we have right now is the inability to analyze your application’s behavior beyond the session’s level. But there is actually a whole &lt;em&gt;set&lt;/em&gt; of bad practices that are there when you are using multiple sessions.&lt;/p&gt;  &lt;p&gt;That led to the creation of a new concept the Cross Session Alert, unlike the alerts we had so far, those alerts looks at the data stream with a much broader scope, and they can analyze and detect issues that we previously couldn’t detect.&lt;/p&gt;  &lt;p&gt;I am going to be posting extensively on some of the new features in just a bit, but in the meantime, why don’t you tell me what sort of features do you think this new concept is enabling.&lt;/p&gt;  &lt;p&gt;And just a reminder, my architecture is based around &lt;a href="http://ayende.com/Blog/archive/2009/03/06/application-structure-concepts-amp-features.aspx"&gt;Concepts &amp;amp; Features&lt;/a&gt;.&lt;/p&gt;</description><link>http://ayende.com/blog/4773/new-uber-prof-concept-cross-session-alerts?key=eeebdd89-c238-4266-b655-fc2be2a2ae50</link><guid>http://ayende.com/blog/4773/new-uber-prof-concept-cross-session-alerts?key=eeebdd89-c238-4266-b655-fc2be2a2ae50</guid><pubDate>Fri, 25 Feb 2011 10:05:00 GMT</pubDate></item><item><title>Uber Prof New Features: A better query plan</title><description>&lt;blockquote&gt;Originally posted at 1/7/2011&lt;/blockquote&gt;&lt;p&gt;Because I keep getting asked, this feature is available for the following profilers:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://nhprof.com"&gt;NHibernate Profiler&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://efprof.com"&gt;Entity Framework Profiler&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://l2sprof.com"&gt;Linq to SQL Profiler&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://llblgenprof.com"&gt;LLBLGen Profiler&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://hibernateprofiler.com"&gt;Hibernate Profiler&lt;/a&gt; &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;This feature is actually two separate ones. The first is the profiler detecting what is the most expensive part of the query plan and making it instantly visible. As you can see, in this fairly complex query, it is this select statement that is the hot spot.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://ayende.com/Blog/images/ayende_com/Blog/WindowsLiveWriter/UberProfNewFeaturesAbetterqueryplan_CDD8/image_8.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://ayende.com/Blog/images/ayende_com/Blog/WindowsLiveWriter/UberProfNewFeaturesAbetterqueryplan_CDD8/image_thumb_3.png" width="1132" height="666" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p /&gt;  &lt;p /&gt;  &lt;p /&gt;  &lt;p&gt;Another interesting feature that only crops up whenever we are dealing with complex query plans is that the query plan can get &lt;em&gt;big&lt;/em&gt;. And by that I mean &lt;em&gt;really&lt;/em&gt; big. Too big for a single screen.&lt;/p&gt;  &lt;p&gt;Therefore, we added zooming capabilities as well as the mini map that you see in the top right corner.&lt;/p&gt;</description><link>http://ayende.com/blog/4752/uber-prof-new-features-a-better-query-plan?key=7d9a03d2-2816-444d-a87c-5750ccf802f3</link><guid>http://ayende.com/blog/4752/uber-prof-new-features-a-better-query-plan?key=7d9a03d2-2816-444d-a87c-5750ccf802f3</guid><pubDate>Sat, 15 Jan 2011 10:00:00 GMT</pubDate></item><item><title>Uber Prof New Features: Go To Session from alert</title><description>&lt;blockquote&gt;Originally posted at 1/7/2011&lt;/blockquote&gt;&lt;p&gt;This is another oft requested feature that we just implemented. The new feature is available for the full suite of Uber Profilers:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://nhprof.com"&gt;NHibernate Profiler&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://efprof.com"&gt;Entity Framework Profiler&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://l2sprof.com"&gt;Linq to SQL Profiler&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://llblgenprof.com"&gt;LLBLGen Profiler&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://hibernateprofiler.com"&gt;Hibernate Profiler&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;You can see the new feature below:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://ayende.com/Blog/images/ayende_com/Blog/WindowsLiveWriter/UberProfNewFeaturesGoToSessionfromalert_C9AD/image_2.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://ayende.com/Blog/images/ayende_com/Blog/WindowsLiveWriter/UberProfNewFeaturesGoToSessionfromalert_C9AD/image_thumb.png" width="1094" height="388" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;I think it is cute, and was surprisingly easy to do.&lt;/p&gt;  &lt;p&gt;Uber Prof have recently passed the stage where it is mostly implemented using itself, so I just had to wire a few things together, and then I spent most of the time just making sure that things aligned correctly on the UI.&lt;/p&gt;</description><link>http://ayende.com/blog/4751/uber-prof-new-features-go-to-session-from-alert?key=b28db449-7214-454f-abbf-7eaf960a299a</link><guid>http://ayende.com/blog/4751/uber-prof-new-features-go-to-session-from-alert?key=b28db449-7214-454f-abbf-7eaf960a299a</guid><pubDate>Fri, 14 Jan 2011 10:00:00 GMT</pubDate></item><item><title>What is Uber Prof’s competitive advantage?</title><description>&lt;blockquote&gt;Originally posted at 11/25/2010&lt;/blockquote&gt;&lt;p&gt;In a &lt;a href="http://ayende.com/Blog/archive/2010/11/24/your-design-should-be-focused-on-your-competitive-advantage.aspx"&gt;recent post&lt;/a&gt;, I discussed the notion of competitive advantage and how you should play around them. In this post, I am going to focus on Uber Prof. Just to clarify, when I am talking about Uber Prof, I am talking about &lt;a href="http://nhprof.com/"&gt;NHibernate Profiler&lt;/a&gt;, &lt;a href="http://efprof.com/"&gt;Entity Framework Profiler&lt;/a&gt;, &lt;a href="http://l2sprof.com/"&gt;Linq to SQL Profiler&lt;/a&gt;, &lt;a href="http://hibernateprofiler.com/"&gt;Hibernate Profiler&lt;/a&gt; and &lt;a href="http://llblgenprof.com/"&gt;LLBLGen Profiler&lt;/a&gt;. Uber Prof is just a handle for me to use to talk about each of those.&lt;/p&gt;  &lt;p&gt;So, what is the major competitive advantage that I see in the Uber Prof line of products?&lt;/p&gt;  &lt;p&gt;Put very simply, they focus very heavily on the developer’s point of view. &lt;/p&gt;  &lt;p&gt;Other profilers will give you the SQL that is being executed, but Uber Prof will show you the SQL and:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Format that SQL in a way that make it easy to read.&lt;/li&gt;    &lt;li&gt;Group the SQL statements into sessions. Which let the developer look at what is going on in the natural boundary.&lt;/li&gt;    &lt;li&gt;Associate each query with the exact line of code that executed it.&lt;/li&gt;    &lt;li&gt;Provide the developer with guidance about improving their code.&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;There are other stuff, of course, but those are the core features that make Uber Prof into what it is.&lt;/p&gt;</description><link>http://ayende.com/blog/4705/what-is-uber-profs-competitive-advantage?key=6dca10eb-7243-4817-8756-300adfc29ee8</link><guid>http://ayende.com/blog/4705/what-is-uber-profs-competitive-advantage?key=6dca10eb-7243-4817-8756-300adfc29ee8</guid><pubDate>Sat, 27 Nov 2010 10:00:00 GMT</pubDate></item><item><title>Profiler new features: Data binding alerts</title><description>&lt;p&gt;The following features apply to &lt;a href="http://nhprof.com/"&gt;NHProf&lt;/a&gt;, &lt;a href="http://efprof.com/"&gt;EFProf&lt;/a&gt;, &lt;a href="http://l2sprof.com/"&gt;L2SProf&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;In general, it is strong discouraged to data bind directly to an IQueryable. Mostly, that is because data binding may actually iterate over the IQueryable several times, resulting in multiple queries being generated from something that can be done purely in memory. Worse, it is actually pretty common for data binding to result in lazy loading, and lazy loading from data binding almost always result in SELECT N+1. The profiler can now detect and warn you about such mistakes preemptively. More than that, the profiler can also now detect queries that are being generated from the views in an ASP.Net MVC application, another bad practice that I don’t like.&lt;/p&gt;  &lt;p&gt;You can find more information about each warnings here:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://efprof.com/learn/alerts/DataBindingQueries"&gt;Data Binding &amp;amp; Queries Shouldn’t Mix&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://l2sprof.com/learn/alerts/QueriesFromViews"&gt;Don’t Query From The View&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;WPF detection:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://ayende.com/Blog/images/ayende_com/Blog/WindowsLiveWriter/ProfilernewfeaturesDatabindingalerts_918F/image_2.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://ayende.com/Blog/images/ayende_com/Blog/WindowsLiveWriter/ProfilernewfeaturesDatabindingalerts_918F/image_thumb.png" width="448" height="120" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p /&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://ayende.com/Blog/images/ayende_com/Blog/WindowsLiveWriter/ProfilernewfeaturesDatabindingalerts_918F/image_4.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://ayende.com/Blog/images/ayende_com/Blog/WindowsLiveWriter/ProfilernewfeaturesDatabindingalerts_918F/image_thumb_1.png" width="751" height="205" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;WinForms detections:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://ayende.com/Blog/images/ayende_com/Blog/WindowsLiveWriter/ProfilernewfeaturesDatabindingalerts_918F/image_8.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://ayende.com/Blog/images/ayende_com/Blog/WindowsLiveWriter/ProfilernewfeaturesDatabindingalerts_918F/image_thumb_3.png" width="563" height="151" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://ayende.com/Blog/images/ayende_com/Blog/WindowsLiveWriter/ProfilernewfeaturesDatabindingalerts_918F/image_6.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://ayende.com/Blog/images/ayende_com/Blog/WindowsLiveWriter/ProfilernewfeaturesDatabindingalerts_918F/image_thumb_2.png" width="733" height="197" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Web applications:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://ayende.com/Blog/images/ayende_com/Blog/WindowsLiveWriter/ProfilernewfeaturesDatabindingalerts_918F/image_10.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://ayende.com/Blog/images/ayende_com/Blog/WindowsLiveWriter/ProfilernewfeaturesDatabindingalerts_918F/image_thumb_4.png" width="581" height="189" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://ayende.com/Blog/images/ayende_com/Blog/WindowsLiveWriter/ProfilernewfeaturesDatabindingalerts_918F/image_12.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://ayende.com/Blog/images/ayende_com/Blog/WindowsLiveWriter/ProfilernewfeaturesDatabindingalerts_918F/image_thumb_5.png" width="743" height="210" /&gt;&lt;/a&gt;&lt;/p&gt;</description><link>http://ayende.com/blog/4642/profiler-new-features-data-binding-alerts?key=d2ea3054-7db3-4e3f-b221-1d71b53d7aef</link><guid>http://ayende.com/blog/4642/profiler-new-features-data-binding-alerts?key=d2ea3054-7db3-4e3f-b221-1d71b53d7aef</guid><pubDate>Mon, 27 Sep 2010 10:00:00 GMT</pubDate></item><item><title>Entity Framework: If you pass a connection to the context, you are responsible for disposing it</title><description>&lt;p&gt;I recently got a bug report about an issue with &lt;a href="http://efprof.com"&gt;EF Prof&lt;/a&gt;, apparently the application statistics would record the context being opened, but it wouldn’t show them being closed. The customer was rightfully worried about that, and wanted to know if this is a bug in his code or in EF Prof.&lt;/p&gt;  &lt;p&gt;Not closing connections is a pretty bad idea, obviously, because you are going to hold a lot more server resources than you need.&lt;/p&gt;  &lt;p&gt;But we couldn’t figure out what the problem was. On my end, I could see that EF Prof was recording the context close properly, but nearly the same code on the customer showed the problem. Note the word &lt;em&gt;nearly&lt;/em&gt;. I asked for a repro of the issue, and once I had it, it took mere minutes to confirm that the problem exists.&lt;/p&gt;  &lt;p&gt;Now was the time to find out &lt;em&gt;why&lt;/em&gt;. The customer code was:&lt;/p&gt;  &lt;blockquote&gt;   &lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;using&lt;/span&gt;(var context = &lt;span class="kwrd"&gt;new&lt;/span&gt; MyContext(&lt;span class="kwrd"&gt;new&lt;/span&gt; EntityConnection(&lt;span class="str"&gt;"name=MyConStr"&lt;/span&gt;))
{
   &lt;span class="rem"&gt;// do stuff&lt;/span&gt;
}&lt;/pre&gt;
  &lt;style type="text/css"&gt;&lt;![CDATA[
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }]]&gt;&lt;/style&gt;&lt;/blockquote&gt;

&lt;p&gt;Now, what EF Prof tells you is a data context open &amp;amp; close are actually more accurately connection open &amp;amp; close. After some extensive study, I verified that it wasn’t my code to blame, there was a leaking connection here.&lt;/p&gt;

&lt;p&gt;Checking a bit further, it became clear. We passed an existing connection to the context. When we dispose the context, the context asks: “Am I the owner of this connection?” And since the answer is no, it will &lt;strong&gt;&lt;em&gt;not&lt;/em&gt;&lt;/strong&gt; dispose it. It makes sense, you might want to use that connection for your own purposes, and it is pretty rude of the context to close a connection that it doesn’t own.&lt;/p&gt;

&lt;p&gt;How can we resolve this? By giving the context the information to open the connection, but not the connection itself:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;using&lt;/span&gt;(var context = &lt;span class="kwrd"&gt;new&lt;/span&gt; MyContext(&lt;span class="str"&gt;"name=MyConStr"&lt;/span&gt;)
{
   &lt;span class="rem"&gt;// do stuff&lt;/span&gt;
}&lt;/pre&gt;
  &lt;style type="text/css"&gt;&lt;![CDATA[
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }]]&gt;&lt;/style&gt;&lt;/blockquote&gt;

&lt;p&gt;This code will instruct the context to open its own connection, which it will know that it owns, so it can safely dispose it when it is disposed.&lt;/p&gt;

&lt;p&gt;Look Ma, no leaks!&lt;/p&gt;</description><link>http://ayende.com/blog/4640/entity-framework-if-you-pass-a-connection-to-the-context-you-are-responsible-for-disposing-it?key=bd798dfc-c7ff-4c1b-b7be-9e4745d2f541</link><guid>http://ayende.com/blog/4640/entity-framework-if-you-pass-a-connection-to-the-context-you-are-responsible-for-disposing-it?key=bd798dfc-c7ff-4c1b-b7be-9e4745d2f541</guid><pubDate>Sat, 25 Sep 2010 10:00:00 GMT</pubDate></item><item><title>Profiler new features, Sept Edition</title><description>&lt;p&gt;The following features apply to &lt;a href="http://nhprof.com"&gt;NHProf&lt;/a&gt;, &lt;a href="http://efprof.com"&gt;EFProf&lt;/a&gt;, &lt;a href="http://hibernateprofiler.com"&gt;HProf&lt;/a&gt;, &lt;a href="http://l2sprof.com"&gt;L2SProf&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;The first feature is something that was frequently requested, but we kept deferring. Not because it was hard, but because it was tedious and we had cooler features to implement: Sorting.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://ayende.com/Blog/images/ayende_com/Blog/WindowsLiveWriter/ProfilernewfeaturesSeptEdition_8A71/image_2.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://ayende.com/Blog/images/ayende_com/Blog/WindowsLiveWriter/ProfilernewfeaturesSeptEdition_8A71/image_thumb.png" width="681" height="135" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Yep. Plain old sorting for all the grids in the application.&lt;/p&gt;  &lt;p&gt;Not an exciting feature, I’ll admit, but an important one.&lt;/p&gt;  &lt;p&gt;The feature that gets &lt;em&gt;me&lt;/em&gt; exciting is the Go To Session. Let us take the Expensive Queries report as a great example for this feature:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://ayende.com/Blog/images/ayende_com/Blog/WindowsLiveWriter/ProfilernewfeaturesSeptEdition_8A71/image_6.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://ayende.com/Blog/images/ayende_com/Blog/WindowsLiveWriter/ProfilernewfeaturesSeptEdition_8A71/image_thumb_2.png" width="609" height="136" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;As you can see, we have a very expensive query. Let us ignore the &lt;em&gt;reason&lt;/em&gt; it is expensive, and assume that we aren’t sure about that.&lt;/p&gt;  &lt;p&gt;The problem with the reports feature in the profiler is that while it exposes a lot of information (expensive queries, most common queries, etc), it also lose the context of where this query is running. That is why you can, in any of the reports, right click on a statement and go directly to the session where it originated from:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://ayende.com/Blog/images/ayende_com/Blog/WindowsLiveWriter/ProfilernewfeaturesSeptEdition_8A71/image_8.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://ayende.com/Blog/images/ayende_com/Blog/WindowsLiveWriter/ProfilernewfeaturesSeptEdition_8A71/image_thumb_3.png" width="538" height="122" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://ayende.com/Blog/images/ayende_com/Blog/WindowsLiveWriter/ProfilernewfeaturesSeptEdition_8A71/image_10.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://ayende.com/Blog/images/ayende_com/Blog/WindowsLiveWriter/ProfilernewfeaturesSeptEdition_8A71/image_thumb_4.png" width="578" height="149" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;We bring the context back to the intelligence that we provide.&lt;/p&gt;  &lt;p&gt;What happen if we have a statement that appear in several sessions?&lt;/p&gt;  &lt;p&gt;&lt;a href="http://ayende.com/Blog/images/ayende_com/Blog/WindowsLiveWriter/ProfilernewfeaturesSeptEdition_8A71/image_12.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://ayende.com/Blog/images/ayende_com/Blog/WindowsLiveWriter/ProfilernewfeaturesSeptEdition_8A71/image_thumb_5.png" width="480" height="219" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p /&gt;  &lt;p&gt;You can select each session that this statement appears in, getting back the context of the statement and finding out a lot more about it.&lt;/p&gt;  &lt;p&gt;I am very happy about this feature, because I think that it closes a circle with regards to the reports. The reports allows you to pull out a lot of data across you entire application, and the Go To Session feature allows you to connect the interesting pieces of the data back to originating session, giving you where and why this statement was issued.&lt;/p&gt;</description><link>http://ayende.com/blog/4632/profiler-new-features-sept-edition?key=ea32c80b-9b96-4fd8-8d41-6c8131c017fa</link><guid>http://ayende.com/blog/4632/profiler-new-features-sept-edition?key=ea32c80b-9b96-4fd8-8d41-6c8131c017fa</guid><pubDate>Fri, 17 Sep 2010 11:00:00 GMT</pubDate></item></channel></rss>