Re: Could Application.DoEvents(); messup code execution ??



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
.



Relevant Pages

  • Re: Sql*plus Auto-Commit
    ... "SET AUTOCOMMIT does not alter the commit behavior when SQL*Plus exits. ... set a WHENEVER SQLERROR EXIT ROLLBACK ...
    (comp.databases.oracle.server)
  • Re: OSS sound core optionalization has __init/__exit mismatches
    ... commit 1be95f401657e75984871c369d774d507e462939 ... make OSS sound core optional ... This is often seen when error handling in the init function ... uses functionality in the exit path. ...
    (Linux-Kernel)
  • OSS sound core optionalization has __init/__exit mismatches
    ... commit 1be95f401657e75984871c369d774d507e462939 ... make OSS sound core optional ... This is often seen when error handling in the init function ... uses functionality in the exit path. ...
    (Linux-Kernel)
  • Re: Anyone have SMTP problems with Evolution?
    ... > prompted for my smtp password at least twice a day. ... > password until I exit the program and restart it. ... To unsubscribe: http://www.redhat.com/mailman/listinfo/fedora-list ...
    (Fedora)
  • Why the form position changes?
    ... My app saves on exit the current position on screen. ... On startup it reads that data and position itself accordingly. ... But twice already I had that problem that application did not show itself on ...
    (microsoft.public.vb.general.discussion)