Home All Groups Group Topic Archive Search About

Async Ado.Net Operations (Begin/End OpenConnection)

Author
29 Sep 2006 8:29 PM
Chris Mullins
We're building high performance database applications, and are trying to use
all the new Async ADO.Net 2.0 features.

The problem we're having is that we can't find a
SqlConnection.BeginOpen/EndOpen method. We can execute everything using the
BeginExecuteCommand, but without the BeginOpen on the connection we end up
with lots of deadlocked threads, all waiting for SqlConnection.Open. This
means things are more-or-less useless.

We looked briefly into MARS for doing this, as that might be an option, but
we really prefer the more standard Async stuff as it maps much easier into
working with other database providers such as Oracle.

What's frustrating is that early Whidbey builds, and many old ADO.Net 2.0
articles, refer to these methods so they existed at one point. These methods
were obviously removed during the .NET 2.0 RTM process, which seems really
strange.

Any ideas how to work around this and actually do highly scalable I/O using
the Async infrastructure in ADO.NET 2.0?

--
Chris Mullins  MCSD.Net, MCPD Enterprise
http://www.coversant.net/blogs/cmullins

Author
1 Oct 2006 4:32 PM
Thomas Weingartner
Chris

The .NET Connection classes can not be used by multiple trheads. You have to use one Connection instance for each thread.

We have built a customized DataAdapter, that will do this for you internally. For each thread, the connection will be stored and reused when you are inside a transaction and call our DataAdapter multiple times. There is also support for nested transactions, dynamic query build from typed datasets and much more.

If you are interested in that component, let me know. Remove the nospam from the email address ;-)

Greetings from Switzerland
Thomas


On Fri, 29 Sep 2006 13:29:39 -0700
Show quote
"Chris Mullins" <cmull***@yahoo.com> wrote:

> We're building high performance database applications, and are trying to use
> all the new Async ADO.Net 2.0 features.
>
> The problem we're having is that we can't find a
> SqlConnection.BeginOpen/EndOpen method. We can execute everything using the
> BeginExecuteCommand, but without the BeginOpen on the connection we end up
> with lots of deadlocked threads, all waiting for SqlConnection.Open. This
> means things are more-or-less useless.
>
> We looked briefly into MARS for doing this, as that might be an option, but
> we really prefer the more standard Async stuff as it maps much easier into
> working with other database providers such as Oracle.
>
> What's frustrating is that early Whidbey builds, and many old ADO.Net 2.0
> articles, refer to these methods so they existed at one point. These methods
> were obviously removed during the .NET 2.0 RTM process, which seems really
> strange.
>
> Any ideas how to work around this and actually do highly scalable I/O using
> the Async infrastructure in ADO.NET 2.0?
>
> --
> Chris Mullins  MCSD.Net, MCPD Enterprise
> http://www.coversant.net/blogs/cmullins
>
>
>

AddThis Social Bookmark Button