ado.net 2.0 changes in latest community drop.

Well, it has been a long time since my last blog and it is going to be a while before I get going again. Whenever this happens you can count on me being either insanely behind or on vacation.

I am happy to report that the insanely behind part is over. The ado.net team has hit ZBB on time and on schedule (I have the WE ROCK mail to prove it :). I am really looking forward to getting some feedback on the latest community drop. There have been some changes… some minor some not so minor. A lot of improvements, bug fixes and sweat lots of sweat. Now it is time to see how it holds out in the real world.

The reason I am not going to be able to pick up blogging where I left off is that next week I am off on vacation. I am thinking it is time to go to a warm country and pass out by a swimming pool.

Important (to me *grin*) changes:

1)The System.Transactions namespace has received a fairly significant makeover.  

The System.Transactions team has been busy, some of their changes affect our components so I am writing what I know about them. This is definitelly not an official source, I am only commenting on the changes in the latest comunity drop.

Transaction.Create has been removed, we now have a CommittableTransaction class to represent a lightweight transaction.

                CommittableTransaction committabletransaction1 = new CommittableTransaction();

You can still specify timeout (default 1 minute) and isolation level by using the newly renamed TransactionOptions. This now supports Snapshot isolation level.

TransactionOptions transactionoptions1 = new TransactionOptions();

transactionoptions1.IsolationLevel = IsolationLevel.ReadCommitted

CommittableTransaction committabletransaction2 = new CommittableTransaction(transactionoptions1);

Checking the GUID of the distributed transaction will no longer promote the transaction to return a valid value, we now support returning null for lightweight transactions.

We can no longer change the default serialization level of a distributed transaction in the config file. Isolation level is a development time concern, not a runtime issue.

The TransactionScope now has only 8 constructors (down from something like 14?). Only Required, RequiresNew and Supress TransactionScopeOptions are now available (making things much less confusing I think)

The TransactionScope Consistent property had a fundamental design problem, it can be set multiple times making it confusing to use, setting it to true and false multiple times inside of the same scope is considered bad. This has been replaced with a method Complete(). This method does not actually complete the distributed transaction, commit will still happen on TransactionScope dispose. The main difference is that after calling this method you can no longer use the distributed transaction.

2) We are trying to get OleDb and Odbc managed connections to auto enlist in System.Transactions transactions.

Currently only SqlClient and the Oracle managed provider support this since they are managed providers instead of wrappers, we are trying to bring this functionality to the managed wrappers (it is hard, so no promises)

3)The ExecuteRow method is now on the verge of being removed.

I hate duplicating the same work with a different api and code path, it always always results in trouble. Removing this (to my eyes)   

unnecessary api would be a big win.

Rambling out,

This post is provided AS IS and confers no rights. The information posted applies only to the latest community drop of the Whidbey framework, NOT to the beta1. Information posted in this post is DEFINITELLY not final.