Page 1 of 1

Terminating UniScript execution

Posted: Mon 18 Oct 2010 01:34
by DepSoft
Hi,

Using D2010 to SQL Server 2008

I have a TUniScript executing from a thread when the application starts up. The script typically takes between 5 and 30 seconds to run. It runs the script within a single transaction.

Normally this works well except if the user decides to close the application immediately after starting it, perhaps they didn't intend to run it, etc.

How can I terminate the thread and the script cleanly and abort the transaction without waiting for the script to finish?

Thanks in advance,

Regards, Paul.

Posted: Wed 20 Oct 2010 08:39
by AndreyZ
Hello,

You can call the BreakExec method of the TUniScript component to stop script execution.

Posted: Wed 20 Oct 2010 08:49
by DepSoft
Thanks for that, I didn't spot that one.

Regards, Paul.