K
Kristijan Marin
Hi,
I have experianced same wierd behavior by one of my customers .....
Here is the thing .... We have the application for newspaper article
management. so adding end editing etc ....
After a while my customer started to complain that they have duplicate
articles in there database ....
so I put some traces on the save event ..... and what I could find out is
that the event method OnClick for save ...
was called 2 or even 3 times in a row ....??? How is this possible ?? What
is even more wierd is that this happens maybe 1 or 2 times from 2500 !!!
I also put some traces when entering the method and exiting the method .....
and I get 2 times enter 1 time exit ?:???
So there can't be error in code .... Ofcourse I COUDN'T repeat this error
not even ones ....
Now the only difference from my PC to customers is that I have .NET
Framework 2.0 SP1 installed and they don't .....
What I did put in the code to force refresh of other processes is :
Application.DoEvents();
Thread.Sleep(300);
Was this wrong ?? Could this mess-up the code execution ??
Another thing that happened was when they tried to edit the article and same
it .... and because they changed the media code .... thumb generation
mechanizem puts
new line in oracle table so that the background process creates new thumb
.....
And what happened was that the code (see bellow) was somehow skiped .....
well I can't see if it was skipped or not, but there was 100% no new line
for thumb generation
void OnClick(...)
{
// some adding and updating of the article
Application.DoEvents();
Thread.Sleep(300);
if (old_media != new_media)
{
///do our table insert for thumbs .....
}
}
So as you can see i called this :
Application.DoEvents();
Thread.Sleep(300);
ones more here in this code .... so maybe this is a problem.....
Would anyone have any clue what is wrong here .
Thanks a lot.
Kris
I have experianced same wierd behavior by one of my customers .....
Here is the thing .... We have the application for newspaper article
management. so adding end editing etc ....
After a while my customer started to complain that they have duplicate
articles in there database ....
so I put some traces on the save event ..... and what I could find out is
that the event method OnClick for save ...
was called 2 or even 3 times in a row ....??? How is this possible ?? What
is even more wierd is that this happens maybe 1 or 2 times from 2500 !!!
I also put some traces when entering the method and exiting the method .....
and I get 2 times enter 1 time exit ?:???
So there can't be error in code .... Ofcourse I COUDN'T repeat this error
not even ones ....
Now the only difference from my PC to customers is that I have .NET
Framework 2.0 SP1 installed and they don't .....
What I did put in the code to force refresh of other processes is :
Application.DoEvents();
Thread.Sleep(300);
Was this wrong ?? Could this mess-up the code execution ??
Another thing that happened was when they tried to edit the article and same
it .... and because they changed the media code .... thumb generation
mechanizem puts
new line in oracle table so that the background process creates new thumb
.....
And what happened was that the code (see bellow) was somehow skiped .....
well I can't see if it was skipped or not, but there was 100% no new line
for thumb generation
void OnClick(...)
{
// some adding and updating of the article
Application.DoEvents();
Thread.Sleep(300);
if (old_media != new_media)
{
///do our table insert for thumbs .....
}
}
So as you can see i called this :
Application.DoEvents();
Thread.Sleep(300);
ones more here in this code .... so maybe this is a problem.....
Would anyone have any clue what is wrong here .
Thanks a lot.
Kris