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?