Re: Could Application.DoEvents(); messup code execution ??
- From: Jon Skeet [C# MVP] <skeet@xxxxxxxxx>
- Date: Thu, 20 Mar 2008 12:11:32 -0000
Kristijan Marin <kristijan.marin@xxxxxxxxxx> wrote:
The flag would not exactly do the job, cause as i described .... I could see
that entering method was done twice , didn't set trace on exit but Commit on
DB was executed only ones ..I would expect Commit to be executed twice too..
and that is the second time I presume ... no Rollback was executed ... cause
if it would then i would know and no RETURN was neither executed .....
Looks just like the code has lost it self somewhere in the middle .... and
as I said in 1 or 2 examples form 2500.... so it's really hard to track ....
but if I can recall i thing that all this stuff started to happen when I
included DoEvents() ..... so now I'll remove all that from code and hope for
the best ...
That's not a reassuring way of coding.
You shouldn't be doing DB work in the UI thread, basically.
Application.DoEvents() is typically used to make the UI responsive
during a long-running activity - but threads are a *much* better way of
doing that.
Unfortunately, threading is not an easy topic.
See http://pobox.com/~skeet/csharp/threads
for an introduction.
--
Jon Skeet - <skeet@xxxxxxxxx>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
World class .NET training in the UK: http://iterativetraining.co.uk
.
- Follow-Ups:
- Re: Could Application.DoEvents(); messup code execution ??
- From: Kristijan Marin
- Re: Could Application.DoEvents(); messup code execution ??
- References:
- Could Application.DoEvents(); messup code execution ??
- From: Kristijan Marin
- Re: Could Application.DoEvents(); messup code execution ??
- From: Marc Gravell
- Re: Could Application.DoEvents(); messup code execution ??
- From: Kristijan Marin
- Could Application.DoEvents(); messup code execution ??
- Prev by Date: Re: Could Application.DoEvents(); messup code execution ??
- Next by Date: Re: Could Application.DoEvents(); messup code execution ??
- Previous by thread: Re: Could Application.DoEvents(); messup code execution ??
- Next by thread: Re: Could Application.DoEvents(); messup code execution ??
- Index(es):
Relevant Pages
|