Andres Aguiar's Weblog

Just My Code
CumUY Meeting / April 26th

Next Thursday we'll meet with the rest of the MS User Group crew in Microsoft's offices at 6.30 pm.

I'll be talking about my favorite new topic, Reactive Extensions, and Jose Russomano will be talking about building WinRT applications with JavaScript. I'll post the slides/samples later.

See you there!


You can find the slides/demo I used here, and a Delicious Stack with links about Reactive Extensions here

Posted: Apr 18 2012, 11:34 PM by aaguiar | with no comments
Filed under:
Deadlocks in Entity Framework

Diego Vega wrote a very informative post that summarizes what you can do when you see deadlock errors in Entity Framework applications. They errors look like:

“Transaction (Process ID 54) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction.”

Even if Diego says that he did not hear about these issues often, I actually saw them quite often in two high-traffic EF applications where I was involved.

Most of the errors are get during reads, so the most likely cause is the one that Diego describes about having readers block readers, and handling the isolation levels in the way Diego suggest would solve it.

In those two websites apps I mentioned, there is a single ObjectContext instance that is shared in per request and it’s used for all the read-only operations, e.g., retrieving the content that will be displayed on a single page. This context has all the entities set to MergeOption.NoTracking in all the entities, to avoid having the EF keep a copy of those instances in the ObjectContext.

It’s quite risky to use the TransactionScope approach together with that, because you cannot put it inside a using statement. You need to create it at the beginning of the request and finish it when at the end, which implies that any method that is transaction-aware will use it, not just the ones for the Read-Only object context.

The solution that kind of worked was to set the isolation level to read uncommitted explicitly in the context by executing a ‘store command’:


Of course, this can only be used if it makes sense in the context of your application. If it’s a banking app with high consistency needs where you cannot show data that is still not committed, it will not be a good idea. But for websites where most of the action is read-only and you don’t have those consistency requirements it seemed to work quite well.


In one of the applications we were using NServiceBus, and those errors appeared when processing a message. In that case, the NServiceBus infrastructure just did what the error message suggests, ‘Rerun the transaction’ Winking smile.


This post also provides information that can be useful when tracking deadlocks.

Run 2012 Montevideo


We are just few minutes away from starting Run 2012 Montevideo!

I'll be doing a fun (at least fun for me) demo in the Windows Phone session and mostly talk over Powerpoints int the Windows 8 sessions. 

You can get to the slides/code here


You can see the videos of these presentations, in Spanish, in Channel 9:

Windows 8

Windows Phone

Posted: Mar 13 2012, 09:58 AM by aaguiar | with 1 comment(s)
Filed under:
Teched Brazil - Next Week!

At the end of next week I'll be in San Pablo presenting in TechEd Brazil.

I won't be able to exercise my newly acquired Portuguese skills in the presentations as they'll be in Spanish but I guess I'll find plenty of opportunities for that during the 3 days I'll stay there.

I'll have two sessions. One about MVC/Entity Framework and another one about Architecture Tools in VS2010.

The event site is not very link-friendly so if you want to see the details about the presentations, you'll need to open the sessions page and filter by  Palestrante = 'Andres Aguiar'.

If you are interested in talking about Infragistics products or in playing with the Build Win8 Tablet I'll be carrying, please contact me through the blog and we'll surely find some time to talk.


Here are the videos for the presentations, translated to portuguese:

- Herramientas de Arquitectura de VS2010 :

- Profundizando ASP.NET MVC 4.0 y EF 4.1 :

Posted: Sep 21 2011, 11:00 PM by aaguiar | with 2 comment(s)
Filed under:
Windows 8, HTML, .NET

You probably heard about Win8 today.

The short story is that they showed a touch-centric shell on top of Win7. Microsoft want us to start building touch-centric apps for that shell using HTML5.

I don’t have any doubts that existing apps will still run with no changes in the old shell.

The main question from a developer point of view is if the only way to write apps for the  new shell will be HTML5 or not. IE will keep supporting Silverlight/WPF/Flash, but those won’t be apps in the new shell but apps inside IE.

For me it’s hard to believe that they won’t support a Silverlight flavor for the shell, but I don’t know the answer.

In any case, it’s clear that with this strategy Microsoft is accepting that they’ve lost the war for the developers’ mind with .NET for client applications. They are still fighting it in the server, but not in the client. Silverlight was the last proprietary technology MS used to try to achieve that, and they failed when “multiplatform” changed from Windows-OSX to Windows-OSX-iOS-Android-AndMarketPlaceRulesThatTheyCannotControl.

They need developers writing apps for Windows. Most of client-side developers today are building HTML apps, another big number are writing iOS and Android apps. Learning XAML technologies is difficult and unappealing for them. As they are losing the battle with iOS/Android, going HTML could be their only option if they want to regain the developer’s love.

The tablets with Windows 8 will be very attractive for Windows users, and it’s the OS with more users on Earth. It wouldn’t be surprising if some developers start targeting that as the main platform, in particular if building those apps is easy. I don’t know if there will be a good story for sharing code between web and native apps, but I guess it will. This means it will be much cheaper for developers to support both platforms (tablet win apps and web).

If Microsoft is successful, it would end up killing native development for Android and iOS, because it could force Apple and Google to come up with similar solutions. They won’t own their developer platform as they used to, but at least nobody will own it.

Of course, if they succeed in making HTML5 the main technology for native client-side apps in all Operating Systems, it will also mean we’ll be able to use that technology for building native apps for Windows Phones…

Does all of this means client .NET is ‘dead’? Depending on your definition of ‘dead’.

CUMUY Meeting - May 31st

I'll be presenting on Entity Framework 4.1 today (yeah today, actually in 45 minutes ;), in Microsoft's Uruguay Offices in our first yearly meeting. You know, we say that in Uruguay the year starts after Easter.

Jorge Corral and Sebastián Beceiro from Arkano will be talking about real-world experiencies with Azure.

 Given that if you are reading this is highly unlikely that you can stop what you are doing and run to today's meeting, I'm posting the powerpoints

Posted: May 31 2011, 06:42 PM by aaguiar | with no comments
Filed under:
CUMUY October Meeting / Moq and Sharepoint

Next Tuesday, October 26th, there will be a new CUMUY meeting. This time, Helena Muñoz from Infragistics Uruguay will be talking about mocking in general and Moq in particular.

Later, Victoria Rodriguez from Arkano will be talking about customization of Sharepoint Libraries.

See you there!

Entity Framework and VS Lightswitch in CUMUY September Meeting

I'll be presenting on Entity Framework at the next CUMUY meeting, next Tuesday, September 28th. Fernando Machado will be talking about Visual Studio LightSwitch.

It won't be the usual introductory or what's new session. I'll dig into our experiences using it while building Quince, show some tricks, and discuss different performance issues.

If you are starting to use EF or evaluating it, you'll get a lot from the presentation. If you've been using it for a while, you'll probably also get some tricks but I hope you can provide the rest of the attendees and myself with some more!

You can register here

Posted from BuqueBus with my IE9

Buenos Aires CodeCamp 2010


For fourth year in a row Infragistics will be sponsoring the Buenos Aires CodeCamp, and I'll be presenting on our experiences with the Entity Framework while building Quince.

We've been using EF for 2 years and learned what works and what does not, how to architect applications around it, how to (ab)use expression trees to maximize code reuse, how to monitor roundtrips, etc. It’s hard to pick what to show as there are a lot of fun things to talk about.

CodeCamp BA is always a great event and the number and quality of speakers increases every year. Check the Agenda!

RIA OpenSpaces Meeting Next Tuesday

Cumuy is organizing a RIA OpenSpaces meeting next Tuesday June 29th at 6.30 PM at Montevideo Microsoft's office.

We'll have @leovernazza from Himalia ;), @lmolfino from d2B, Alex Bonjour / @vertexray from VertexRay, Pablo Panedas from Innicia and whoever wants to show up sharing a conversation about the present and future of RIA technologies.

Please register here .


Posted: Jun 24 2010, 09:13 PM by aaguiar | with 1 comment(s)
Filed under:
More Posts Next page »