I think Mike (and Ian, and some others) have reconsidered that pattern,
after some feedback from MS /changes in the documentation in 1.1 on this. In
particular, IIRC, there was the possibility of leakage when not calling
EndInvoke. Check the archives for more information...

John

-----Original Message-----
From: Moderated discussion of advanced .NET topics.
[mailto:[EMAIL PROTECTED] On Behalf Of Erymuzuan Mustapa
Sent: 10. oktober 2003 04:54
To: [EMAIL PROTECTED]
Subject: Re: Async Data Commands with ADO.Net

Well, if you don't care about the result and want to take care of the
thread, take a look at Woodring's fire and forget
http://staff.develop.com/woodring/dotnet/#FireAndForget

Regard
Erymuzuan Mustapa

-----Original Message-----
From: Moderated discussion of advanced .NET topics.
[mailto:[EMAIL PROTECTED] On Behalf Of Jade Burton
Sent: 08 October 2003 11:15
To: [EMAIL PROTECTED]
Subject: Re: [ADVANCED-DOTNET] Async Data Commands with ADO.Net

But what's wrong with creating a thread?  If you use the threadpool it's
almost a one-liner!  (Aside from the stub you'll prob have to write..)

I guess it's personal preference whether you prefer to use special async
APIs or whether you prefer fns that block until complete -- I personally
avoid async APIs like the plague - they split my code into two parts - a
caller and an event handler, which I find harder to manage (and which
reminds me of the Win16 message model ;) ).

For example:

void SomeFunc()
{
        LengthyTaskA();
        LengthyTaskB();
}

versus:

void SomeFuncStart()
{
        LengthyTaskA_Start(new [delegate to OnLengthyTaskAComplete]); }

void OnLengthyTaskAComplete()
{
        LengthyTaskB_Start();
}

Even if I don't care about the result of the call or when it finishes I
generally do not use async APIs because I like to be responsible for the
lifetime of the threads in my app (or have that option in the future.)

Jade Burton

-----Original Message-----
From: Moderated discussion of advanced .NET topics.
[mailto:[EMAIL PROTECTED] Behalf Of Brian Gaer
Sent: Wednesday, 8 October 2003 9:09 AM
To: [EMAIL PROTECTED]
Subject: [ADVANCED-DOTNET] Async Data Commands with ADO.Net


Is anyone familiar with a method to have an ADO.Net command object perform a
command.ExecuteNonQuery() asynchronously?



The Stored Proc I am calling takes from 2 to 10 minutes to return, and I
cannot wait for it and do not care what the results of the query are.
I searched all over and the only option I have found is creating a new
thread to make the database call.



Is there any other way that anyone is aware of?



Language: C#,

Database MSSQL Sever 2000

Using ADO.Net



Thank you,



Brian Gaer

[EMAIL PROTECTED]




===================================
This list is hosted by DevelopMentor.  http://www.develop.com NEW! ASP.NET
courses you may be interested in:

2 Days of ASP.NET, 29 Sept 2003, in Redmond
http://www.develop.com/courses/2daspdotnet

Guerrilla ASP.NET, 13 Oct 2003, in Boston
http://www.develop.com/courses/gaspdotnet

View archives and manage your subscription(s) at http://discuss.develop.com

--
This message has been scanned for viruses and dangerous content by
MailScanner, and is believed to be clean.


--
This message has been scanned for viruses and dangerous content by
MailScanner, and is believed to be clean.

===================================
This list is hosted by DevelopMentor.  http://www.develop.com NEW! ASP.NET
courses you may be interested in:

2 Days of ASP.NET, 29 Sept 2003, in Redmond
http://www.develop.com/courses/2daspdotnet

Guerrilla ASP.NET, 13 Oct 2003, in Boston
http://www.develop.com/courses/gaspdotnet

View archives and manage your subscription(s) at http://discuss.develop.com


---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.524 / Virus Database: 321 - Release Date: 06/10/2003


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.524 / Virus Database: 321 - Release Date: 06/10/2003

===================================
This list is hosted by DevelopMentorR  http://www.develop.com NEW! ASP.NET
courses you may be interested in:

2 Days of ASP.NET, 29 Sept 2003, in Redmond
http://www.develop.com/courses/2daspdotnet

Guerrilla ASP.NET, 13 Oct 2003, in Boston
http://www.develop.com/courses/gaspdotnet

View archives and manage your subscription(s) at http://discuss.develop.com

===================================
This list is hosted by DevelopMentorŪ  http://www.develop.com
NEW! ASP.NET courses you may be interested in:

2 Days of ASP.NET, 29 Sept 2003, in Redmond
http://www.develop.com/courses/2daspdotnet

Guerrilla ASP.NET, 13 Oct 2003, in Boston
http://www.develop.com/courses/gaspdotnet

View archives and manage your subscription(s) at http://discuss.develop.com

Reply via email to