473,583 Members | 2,875 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Mysteriously invincible process

I've got a program that contains a crystal report, and it has a function that
saves off one report for each branch of the company, in a loop.
This all works beautifully, however - if the user closes the form while the
saving is taking place (it does take quite a long time) then it mysteriously
CARRIES ON saving the PDFs! The process is still there, just the form is
invisible.
I tried setting a flag to true and calling Dispose on the actual crystal
report ReportDocument object, both of which happen without error, and
although now it stops saving as the flag causes the loop to exit, the process
doesn't die.

Does anybody know of any way to determine what's keeping it alive?

Nov 16 '05 #1
6 1340
Patty O'Dors <Pa********@dis cussions.micros oft.com> wrote:
I've got a program that contains a crystal report, and it has a function that
saves off one report for each branch of the company, in a loop.
This all works beautifully, however - if the user closes the form while the
saving is taking place (it does take quite a long time) then it mysteriously
CARRIES ON saving the PDFs! The process is still there, just the form is
invisible.
I tried setting a flag to true and calling Dispose on the actual crystal
report ReportDocument object, both of which happen without error, and
although now it stops saving as the flag causes the loop to exit, the process
doesn't die.

Does anybody know of any way to determine what's keeping it alive?


Is it saving the PDFs in another thread? If so, that's probably what's
keeping it alive. The process stays alive until all non-background
threads have terminated.

--
Jon Skeet - <sk***@pobox.co m>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 16 '05 #2
Hi,

I think this is what is happening,

Maybe with process explorer from sysinternals.co m you can see it.

In any case I think that if this process is going to be so time consuming
that the user may get bored and close the program before it ends you should
try another thing, like scheduling a job to be run in the background or
later, most of the time probably the user that start the process does not
care about the reports in the first time :)

Take a look at this post from Willy
http://groups.google.com/groups?hl=e...ftngp04&rnum=4
Cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Jon Skeet [C# MVP]" <sk***@pobox.co m> wrote in message
news:MP******** *************** @msnews.microso ft.com...
Patty O'Dors <Pa********@dis cussions.micros oft.com> wrote:
I've got a program that contains a crystal report, and it has a function that saves off one report for each branch of the company, in a loop.
This all works beautifully, however - if the user closes the form while the saving is taking place (it does take quite a long time) then it mysteriously CARRIES ON saving the PDFs! The process is still there, just the form is
invisible.
I tried setting a flag to true and calling Dispose on the actual crystal
report ReportDocument object, both of which happen without error, and
although now it stops saving as the flag causes the loop to exit, the process doesn't die.

Does anybody know of any way to determine what's keeping it alive?


Is it saving the PDFs in another thread? If so, that's probably what's
keeping it alive. The process stays alive until all non-background
threads have terminated.

--
Jon Skeet - <sk***@pobox.co m>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too

Nov 16 '05 #3
Hi Patty,

It should be running on another thread, if it were running on the main
thread ( UI thread ) the interface will lock.

Again, I think that you should consider a non visible method for this,
either a scheduled job or even using MSMQ

Cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"Patty O'Dors" <Pa********@dis cussions.micros oft.com> wrote in message
news:18******** *************** ***********@mic rosoft.com...
No! It's not. It's right in the button's auto-generated handler.
"Jon Skeet [C# MVP]" wrote:
Patty O'Dors <Pa********@dis cussions.micros oft.com> wrote:
I've got a program that contains a crystal report, and it has a function that saves off one report for each branch of the company, in a loop.
This all works beautifully, however - if the user closes the form while the saving is taking place (it does take quite a long time) then it mysteriously CARRIES ON saving the PDFs! The process is still there, just the form is invisible.
I tried setting a flag to true and calling Dispose on the actual crystal report ReportDocument object, both of which happen without error, and
although now it stops saving as the flag causes the loop to exit, the process doesn't die.

Does anybody know of any way to determine what's keeping it alive?


Is it saving the PDFs in another thread? If so, that's probably what's
keeping it alive. The process stays alive until all non-background
threads have terminated.

--
Jon Skeet - <sk***@pobox.co m>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too

Nov 16 '05 #4
Patty O'Dors <Pa********@dis cussions.micros oft.com> wrote:
It should be running on another thread, if it were running on the main
thread ( UI thread ) the interface will lock.
The interface doesn't lock - it stays responsive as if I have put it in
another thread, but I'm telling you I haven't.

I can only assume that this is because, although I haven't multithreaded
myself, the method ExportToDisk of the crystal report uses another thread
itself and it is probably this that takes 99% of the time of the loop. It
definitely does seem weird....


I suggest you break into the debugger and see what threads are around
to check it out.
Is what you're saying that if I DO put it in another thread, then it will be
easier to kill it - as I will have an explicit object reference to the thread
that's doing the work, and I will just be able to give it a
ThreadAbortExce ption whenever the form closes?


No - if it's creating a new thread now, I would be very surprised if it
didn't create the thread regardless.

Is there no documented way of waiting until it's finished? If there
was, you could wait for each individual PDF to finish, testing a flag
between each file.

--
Jon Skeet - <sk***@pobox.co m>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 16 '05 #5
I suggest you break into the debugger and see what threads are around
to check it out.
There's three - one that's listed as being in the button handler function
and two that just have no name. But there are the same three wherever I break
into the program.
Is what you're saying that if I DO put it in another thread, then it will be
easier to kill it - as I will have an explicit object reference to the thread
that's doing the work, and I will just be able to give it a
ThreadAbortExce ption whenever the form closes?
No - if it's creating a new thread now, I would be very surprised if it
didn't create the thread regardless.


From the threads window it would seem that no part of the saving process is
creating any other threads.

Is there no documented way of waiting until it's finished? If there
was, you could wait for each individual PDF to finish, testing a flag
between each file.

--
Jon Skeet - <sk***@pobox.co m>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too

Nov 16 '05 #6
Patty O'Dors <Pa********@dis cussions.micros oft.com> wrote:
I suggest you break into the debugger and see what threads are around
to check it out.


There's three - one that's listed as being in the button handler function
and two that just have no name. But there are the same three wherever I break
into the program.


Hmm.
Is what you're saying that if I DO put it in another thread, then
it will be easier to kill it - as I will have an explicit object
reference to the thread that's doing the work, and I will just be
able to give it a ThreadAbortExce ption whenever the form closes?


No - if it's creating a new thread now, I would be very surprised if it
didn't create the thread regardless.


From the threads window it would seem that no part of the saving process is
creating any other threads.


Hmm. That sounds extremely odd then. Perhaps it's creating other native
threads, and VS.NET doesn't show them? (Not sure.)

--
Jon Skeet - <sk***@pobox.co m>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 16 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2589
by: Peter Åstrand | last post by:
There's a new PEP available: PEP 324: popen5 - New POSIX process module A copy is included below. Comments are appreciated. ---- PEP: 324 Title: popen5 - New POSIX process module
2
12071
by: Alex Smith | last post by:
Hi all, I have an application that uses Oracle's JDBC thin driver 9.0.x to have a nice, friendly chat with 8.1.x database. During this exchange the server rudely interrupts the conversation and causes the application to fubar. The driver reports this as 'Connection reset' (IOException) without any error numbers. The server is hosted by a...
2
2602
by: C Kirby | last post by:
I'm running a DB using MSDE (2000) that is interfaced by 2 different ades running on PCs with Access 2000 Runtime. One of the ADEs is a package accounting system that is very solid and stable, the other is a custom application that I wrote (much less solid and stable). The custom app only deals with a select few tables in the database, and...
12
2905
by: serge calderara | last post by:
Dear all, I have an application which is suppose to start another executable process. As soon as that process is running, I need to retrive its handle. The problem of the particular process I am starting is that it has a welcome window first which gets displayed and then the real windows after a while,in other words it means that the...
0
1342
by: Jerry Negrelli | last post by:
I have a windows service that is mysteriously dying on me at what appears to be random intervals. Sometimes its 3 hours, sometimes it's 2 days. Clearly an error is occuring but I haven't been able to pinpoint the problem The service's OnStart method initializes an object whose constructor creates a thread that launches other threads based on...
2
1040
by: Bonj | last post by:
I have got an issue with a subform of an application that I have. Basically, the subform displays a crystal report, and this works fine - it's just that when you want to close it, it won't close. Clicking its cross button does absolutely nothing, neither does any method of trying to close it other than ending its process. While this doesn't...
0
464
by: joe martin | last post by:
Sometimes when I run my C# application I am developing the keyboard repeat rate mysteriously goes down all the way. When I check in HKEY_CURRENT_USER\ControlPanel\Keyboard\KeyboardSpeed it is still set to 30 but in the control panel the slider is all the way at the left. Currently I read and write to the registry in my own tree inside...
3
1482
by: Danny J. Lesandrini | last post by:
I asked this on microsoft.public.access, but got no answers. Maybe I was too verbose ... or there is no answer. User opens form A and then form B While typing in form B, focus jumps to last active control on form A User curses at development staff This has also been observed to happen while the user was not touching the mouse or...
5
1066
by: Todd | last post by:
Hello everyone, I ran a python script last night which connects to a matlab automation server via DCOM (using win32com). I expected to see the results when I came in this morning. But apparently, not long after I left, python stopped. I hit enter in the console, and it started again. I scoured the handful of lines of code to see if...
0
7811
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8159
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7922
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8185
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5366
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3811
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2317
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1416
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1147
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.