Link to home
Start Free TrialLog in
Avatar of Stef Merlijn
Stef MerlijnFlag for Netherlands

asked on

Break processing of procedure

Hi,

In very rare cases processing of a button-onclick (send E-mail) procedure freezes on a customer's PC. Till now I haven't been able to trace the cause of this behaviour, but it is of the essence that my application doesn't have to be shutdown (the hard way) in order to preserve some data.

Therefore I want to add an option for the user to KILL the process, without the need to end program execution.

Can anybody advice me on how to accomplish this?
Avatar of SteveBay
SteveBay
Flag of United States of America image

Have you tried putting a try/except wrapper in your Button OnClick event handler?
Avatar of Stef Merlijn

ASKER

Yes, but there is no error. It freezes at some point in the process.
You say it is sending an Email. How are you doing that? MAPI?
I'm using components from Clever Components Suite. Sending is done directly via SMTP.
Have you contact Clever Components developers? They might help you. They know things under the hood ....
Yes, we did some logging, but nothing out of the ordinairy.
That's why I ask my question. I ran out of options for now.
I don't know Clever Comp.

Freezing does not necessarily equal crash. Perhaps the component is somehow getting into an endless loop.  

If you can't fix the freeze... let me suggest a different approach: Maybe you could create a fail-safe file that contains critical recovery data before starting your Email process. If the process succeeds (doesn't freeze) you delete the file. If the file exist upon restart then you know the program had to be crashed, therefore you know that you need to apply the recovery data before continuing. I know it's kind of an ugly work-around, of course the best solution is to not freeze in the first place.
The only way I could recover as suggested, I would need to copy DB-records just before mailing. But in a multi user environment it's not very reliable/useful.

I prefer to terminate the mailing somehow.
ASKER CERTIFIED SOLUTION
Avatar of SteveBay
SteveBay
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
... or you can use Indy components....
Thank you!