Enterprise Library 3.0 DAAB Improvements To Date

Enterprise Library 3.0 DAAB Improvements To Date

by David Hayden 

I can't help but get excited about the new features in Enterprise Library 3.0 as well as the new software factories put out by the Microsoft Patterns and Practices Team. This week I locked myself in my office and spent all my free time on the Web Client Software Factory and the new Composite Web Application Block and Page Flow Application Block. These are great tools to have in your toolbox and are overflowing with practices that can help improve your development.

Over the past few months I have been monitoring and playing with the new changes in Enterprise Library 3.0. The Data Access Application Block has a few cool changes and there may be more before EntLib 3.0 is released. Here are a list of DAAB improvements worth mentioning ( as of January 2007 CTP ).

Batch Update Functionality

The Database.UpdateDataSet Method now includes an overload that allows you to specify a batch update size:

 

Database.UpdateDataSet(DataSet dataSet, string tableName,
    DbCommand insertCommand, DbCommand updateCommand,
    DbCommand deleteCommand, UpdateBehavior updateBehavior,
    int? updateBatchSize);

 

TransactionScope Support

We now have support for System.Transactions and TransactionScope. The DAAB looks to see if a transaction is happening and caches open connections for re-use with other commands so a Distributed Transaction won't occur if using the same connection. Hence the following is now possible in Enterprise Library 3.0 without causing a Distributed Transaction:

 

using (TransactionScope scope = new TransactionScope(...))
{
    database.ExecuteNonQuery(...);
    database.ExecuteNonQuery(...);

    // ....

    scope.Complete();
}

 

SQL Server 2005 Compact Edition Support

A new class has been added to the DAAB specifically for SQL Server 2005 Compact Edition, called SqlCeDatabase. There is a CreateFile Method that uses the CreateDatabase method found in the SqlCeEngine Class as well as a TableExists Method that uses the INFORMATION_SCHEMA Classes to query for the existence of a table. In addition, it comes with a new connection pooling class to offer connection pooling services for SQL Server 2005 Compact Edition. Great Stuff:

 

bool tableExists = database.TableExists("Subscribers");

 

Conclusion

You can download the January 2007 CTP here to try out the changes for yourself.

 

Additional Resources

 by David Hayden

 

This entry was posted in Uncategorized. Bookmark the permalink. Follow any comments here with the RSS feed for this post.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>