Dennis van der Stelt

The most votes generally drown out the best votes

Community

News

  • Meet me at PDC08

Email Notifications

I read...

I Use...

Tags

Recent Posts

Archives

June 2007 - Posts

System.Transactions still not working

UPDATE : It seems the SQL team actually have build a solution. 

A while ago I wrote some articles on System.Transactions and the fact that it's almost impossible to use the Lightweight Transaction Manager (LTM) and not get bumped up to a distributed transaction and use MSDTC.

When you look at the sourcecode it's easy to see what's happening

  1. Open a connection to MyServer with using keyword
  2. Execute an insert statement to TestTable
  3. Close using, but the connection stays open in the background to reply to ready-to-commit question.
  4. Open a new connection to MyServer with using keyword
  5. We're already using a distributed transaction

 

string ConnectionString = @"Data Source=MyServer;Initial Catalog=Test;Integrated Security=SSPi;";

 

using (TransactionScope scope = new TransactionScope())

{

  using (SqlConnection conn1 = new SqlConnection(ConnectionString))

  {

 

    SqlCommand cmd1 = new SqlCommand("insert into TestTable([value]) Values ('This creates a new row')", conn1);

    conn1.Open();

    cmd1.ExecuteNonQuery();

    Console.WriteLine("DistributedID : {0}", System.Transactions.Transaction.Current.TransactionInformation.DistributedIdentifier);

  }

 

  using (SqlConnection conn2 = new SqlConnection(ConnectionString))

  {

    SqlCommand cmd2 = new SqlCommand("insert into TestTable([value]) Values ('This creates a new row')", conn2);

    conn2.Open(); // Promotion to MSDTC occurs!

    cmd2.ExecuteNonQuery();

    Console.WriteLine("DistributedID : {0}", System.Transactions.Transaction.Current.TransactionInformation.DistributedIdentifier);

  }

}

 

When you look at this thread on MSDN Forums, Pablo Castro said that it's a server-side (SQL Server) fix. Florin Lazar replies that this issue will likely not be addressed in Visual Studio Orcas (VS2008 by now).

Florin is right, it still doesn't work in Visual Studio 2008.
Even worse, it's also not addressed in SQL Server 2008.

Update : Or is this the solution we've been waiting for? 

So my question is, when is Microsoft going to address this issue?! When will System.Transactions work like it's supposed to?

Silverlight controls suite

goa_winformsCurrently SilverLight doesn't support a lot of controls. Via Tim Sneath I found Netika Tech whom build this suite of controls called GOA WinForms for SilverLight and Flash. It has over 40 standard controls and components to use Windows like controls in your SilverLight application. Skinning seems to be possible, although I believe this is only possible via code.

There's also a professional version with even more controls, but you'll have to pay for this package. The demos are a bit slow, but as Tim Sneath points out, these are alpha controls running on an alpha SilverLight.

It's a bit weird what they're doing though, because your SilverLight "form" has to start inheriting from System.Windows.Forms.Form. I haven't had the change, but it should be interesting taking a look at them with Reflector.

Although they're worth checking out, because they look great, it's a bit of a shame if people start using controls like this too often. SilverLight should bring a much richer user experience.

Technorati tags:
TFS Get latest version on checkout

As most Team Foundation Server (TFS) users will know by now, upon checkout of a file from source control, the latest version isn't retrieved. For a lot of users very odd, while this was the cast in Visual Source Safe. This is actually by design. And this time "by design" doesn't mean it's a bug (or feature, if you will). Buck Rogers Hodges explains why and I think it's an excellent reason.

Just read though, on Roy Osherove's weblog that there's a new add-in for Visual Studio that'll check the version of the file you're checking out and if it's not the latest version, a popup will appear asking if you want to get the latest version. There are other add-ins that do this, but they don't ask the question, they just do.

It's something I'll never install and use, because I believe TFS works the way it should be on that matter. But it's good to have the choice.

The state of shared vision

I'm reading "Dynamics of software development" by Jim McCarthy, kind of a mandatory when you work at Class-A. It's an 'old' book, considering how young IT actually is, but last year McCarthy published an updated version. The book contains 57 rules for delivering great software on time. The first rule was, is and stays the most important one:

"Create a shared vision"

In my experience this is so important for a number of reasons.

  1. We want to be heading for the same goal.
    This seems very trivial, but it isn't. People in your project might think they know where we're heading and what they need to build, document or test, but they might not know why we are heading there and what route to take!!!

    For example, on a project I was recently on, some on the project were creating their design and thinking and drawing every tiny bit if detail they could think of. On the other hand, management wanted a product out on the market a.s.a.p. for various reasons that don't concern this article.

    Without interference, the product would've taken much longer to build, despite the wishes of management. And this because of a lack of shared vision.
  2. Sharing a passion
    While we're heading for the same goal, we're sharing a passion. I see programming as an art, not work. Everyone can create cool drawings, but not everyone can truly paint. The same goes for software development. And when we're all heading for the same goal, we're sharing a passion. And when we share a passion, we truly become a team and we can achieve the greatest things!

    "When people say 'hard work,' what they really mean is using individual heroics to compensate for the inefficiencies of the system," says McCarthy. "It sucks. But that's how most of us make software."

    Share a passion and be a team!
  3. It might be easier to accept seemingly weird decisions.
    There are these times when management executes some decision that developers, testers or others on the team cannot agree with. I'm one of those people taking my thoughts to management and telling them what I actually think of their utterly stupid decision. Until they tell me why they took this decision and I actually start thinking "Hey, they actually thought this out. And while it's technically not the best solution, for the project and/or the product this might actually be the best solution."

    In other words, people in your project might actually accept decisions when they know the reasoning behind it. And again, you'll get a shared vision on what's the right path to the best solution.

 

The solution that Microsoft Solutions Framework suggests is creating a "Vision & Scope" document. In it should be some project background, why we're actually going to develop some product. Also the driving factors are very important and wether it's driven by date or functionality. The key value is also important. Is the key value to make the world a better place, to make money very quickly, to see what the product will do on the market, to create the best looking product in the world, etc, etc. The simple 'key values' require a completely different approach on how to create this product. And identifying users could be important. Are the users 50+ years old or some kids? Are they highly experienced users, new, or both?!

Also a Vision Statement should be nice. One vision statement that's well known by most is "Get a pc on every desktop in every home" from the greatest visionary in the world, Bill Gates. :-) Another one from the SQL-Server team, very simple : "Beat Oracle". Last year for Class-A we had "One step ahead" and this year it's "Happy to communicate, live or later" as we're currently trying to implement "The new world of work" (Dutch) inside Class-A and with our customers.

Developer Days

I've had a really good time at the Dutch Developer Days 2007, meeting a lot of people. Also had some good time fighting people with lightsabers. The Class-A stand was right beside it, so we had a lot of opportunities to take pictures. Especially during the sessions. ;-)

When the photographer made a comment about me being a "Trekkie", when I knew the sabers where actually called lightsabers, I just had to explain this was Star Wars, and not that other movie... I immediately explained to him what the difference is between Star Wars and Star Trek. Because in Star Trek it's really noticeable that the set is made up of carton and such, and Star Wars actually really happened. As everyone, he found that very funny, actually going : "Huh huh huh, yeah, right..."

Anyway, here are the pictures! :-)

devdays2007-starwars1

 Alex Thissen and me

devdays2007-starwars2

Marco Stolk, Robert Jan van Holland, me and Patrick Bes

devdays2007-starwars3

Astrid Hackenberg and me

Technorati tags: ,
Zoom-in on 'watch popup'

During his 'Applied Linq' presentation at the Developer Days 2007, Alex Thissen tried to zoom-in on some variable. I have no idea how this popup is called, but it's kind of a watch in a popup, therefor a 'watch popup' ? Anyhow, Alex tried to zoom-in on it as you can't (easily) modify its font-size. I've told him a dozen times he should use ZoomIt for this, a tool by SysInternals. Unfortunately, it didn't work.

Alex has his ZoomIt key mapped to alt-1. When pressing alt in Visual Studio it'll immediately think you want to open the menu and close the 'watch popup'. I have the same problem with Media Player Classic, which uses alt-1 to alt-3 for setting the window size. Therefor I remapped my ZoomIt key to ctrl-1. The default is actually ctrl-1. Now this does work for the 'watch popup', if it wasn't for another annoying feature of Visual Studio. Pressing the ctrl key will make the 'watch popup' transparent, resulting in the following...

Watch popup after pressing ctrl key

As far as I can tell, there's no solution to this. I've searched in the tons of keyboard mappings in Visual Studio, but can't find anything on the transparency of the 'watch popup'.

There is however another solution. Alex could've pressed SHIFT-F9 for the QuickWatch window, very usable by ZoomIt! ;-)

Summer Classes 2007

At Class-A we're preparing for the Summer Classes. Last year was the first time we organized this event and gave the first .NET 3.0 trainings ever in Holland. This year we'll provide you with all the information you want about:

Alex Thissen, Pascal Naber, Frits Ankersmit and me will be delivering the .NET 3.5 class. Mike Glaser, Anko Duizer en Astrid Hackenberg will be delivering the BI class.

Each Summer Class will be delivered in Domburg in an hotel at the sea for 5 days straight, with entertainment in the evening. Alex and I will deliver some additional entertainment in the form of CounterStrike and/or BattleField 2 multiplayer games at the .NET 3.5 class.

But the main goal of the Summer Classes is to provide you with information you can take home and to work and actually use. For the .NET 3.5 class this means we'll explain almost all the new stuff, added with practical information. The difference is that people who might go to some conference in, let's say Barcelona, will get a lot of information but only the good stuff and hardly any hands on. At our Summer Classes you'll hear everything, the truth and get a lot of hands on practices. Instead of being able to focus what you're going to invest on R&D, you'll return home and be able to focus your architectures and designs on what you know is best, because you've just learned what the options are and how to implement them.

To be able to do this, you'll build an application in 5 days. We'll start of simple with the technologies you're used handed to you, and expand and upgrading the application to use just about the entire .NET Framework 3.5. We'll even throw some SilverLight in, just because Alex and I are so enthusiastic about it.

If you want more info, visit the Class-A website, or visit us at the Developer Days (we have our own booth with a palm tree in it) in the RAI on June 13 and 14 or contact me personally. I'll be at the DevDays the 13th. If you want to meet up, don't hesitate to contact me.

Visual Studio 2008, VS2008 Shell and SQL Server 2008

At MIX07 new stuff was announced, at TechEd 2007 in Orlando names of products have been announced.

  • Visual Studio 2008
    "Orcas" has been renamed to Visual Studio 2008. It's a bit strange so few people have yet to blog about it, the only real reference I could find was at Darryl Burling's weblog. I started searching after reading Daniel Moth's weblog.
  • Visual Studio 2008 Shell
    This info has also been released at TechEd. From what I understand, you can integrate the VS2008 shell into your own application, enabling it the advanced IDE features that VS2008 offers you. Read more at the VS2008 Shell weblog.
  • SQL Server 2008
    Yes, "Katmai" also got its final name. Read more at the SQL website.

 

According to Daryll Burling these names have nothing to do with the year, but more about the financial year these products will be released. As far as I'm know, the financial year of 2008 begins before the calendar year of 2008. Meaning VS2008 might be released in 2007, but SQL Server 2008 can't be released at the end of the year 2008. We'll see! :)