Modifying the Data Access Application Block (May, 2007 release)

Topics: Building and extending application blocks, Data Access Application Block, General discussion
Jan 16, 2008 at 3:19 PM
Edited Jan 16, 2008 at 3:20 PM
What's the best way to add an asynchronous BeginExecuteReader method and it's accompanying functionality to the DAAB? Do I just add these methods to the Database class and recompile?

Why isn't asynchronous calls part of the DAAB in the first place?

Feb 8, 2009 at 1:00 AM
Absolutely the right question.  Why is DAAB not supporting async API?  This is pathetic.  Async programming model is key for scalability on servers.  This is a big no go for DAAB.
Feb 9, 2009 at 7:51 AM
The answer to your first question would be yes, as DAAB doesn't have support for ansynchronous calls.  Here's some sample codes from CodeProject that adds asynchronous functionality in DAAB -

As for the same question from both of you, that's something I can't answer.  I'll have to get the answer from the EntLib team.

Sarah Urmeneta
Global Technology & Solutions
Avanade, Inc.
Feb 10, 2009 at 3:14 AM
Sarah, Thanks for your reply.  Although the code is nice for the time when it was written (2003) it does not take advantage of ADO.NET's intrinsic async support, i.e. using BeginExecuteReader function.  ADO.NET did not support async API in 2003. What would be great is having the code modified to use ADO.NET's intrinsic async support.  -Lucius
Feb 10, 2009 at 6:42 AM
Edited Feb 10, 2009 at 10:46 AM

Sorry, didn't read much the code.  You could modify the source code to expose the async calls in ADO.NET but only for those database provider which supports it, e.g. SqlDatabase.  I think this is the reason why DAAB didn't include support for this.  Regardless of what providers they belong to, all command objects in entlib are of DBCommand types but not all of them support asynchronous methods.  DAAB is just a wrapper of ADO.Net so it can't have what ADO doesn't have.

Sarah Urmeneta
Global Technology & Solutions
Avanade, Inc.