473,386 Members | 1,720 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

How can I exit a method prematurely

Hi,

I've implemented a windows service that calls an SSIS package. Every
so often, the SSIS package does not return control to the calling
method. What I've implemented is a sentinel thread that is spawned
before the execute method of the SSIS package which will email me if
execution occurs for a prolonged period. What I want to know is, how
can I implement a solution that will force the SSIS object to timeout
and return control to the calling method in the event handler of the
sentinel thread? Code samples would be appreciated.

Thanks,

Roger
Mar 28 '08 #1
4 2916
On Mar 28, 3:29*pm, Roger <roger.canti...@gmail.comwrote:
Hi,

I've implemented a windows service that calls an SSIS package. *Every
so often, the SSIS package does not return control to the calling
method. *What I've implemented is a sentinel thread that is spawned
before the execute method of the SSIS package which will email me if
execution occurs for a prolonged period. *What I want to know is, how
can I implement a solution that will force the SSIS object to timeout
and return control to the calling method in the event handler of the
sentinel thread? *Code samples would be appreciated.

Thanks,

Roger
To exit out of a method before it has completed, just do a:

return;
Mar 28 '08 #2
On Mar 28, 3:53 pm, za...@construction-imaging.com wrote:
On Mar 28, 3:29 pm, Roger <roger.canti...@gmail.comwrote:
Hi,
I've implemented a windows service that calls an SSIS package. Every
so often, the SSIS package does not return control to the calling
method. What I've implemented is a sentinel thread that is spawned
before the execute method of the SSIS package which will email me if
execution occurs for a prolonged period. What I want to know is, how
can I implement a solution that will force the SSIS object to timeout
and return control to the calling method in the event handler of the
sentinel thread? Code samples would be appreciated.
Thanks,
Roger

To exit out of a method before it has completed, just do a:

return;
The problem is, the SSIS object retains control due to a deadlocking
issue and doesn't give me the opportunity to return. I need another
method of raising exception from method without stopping the service
outright.
Mar 28 '08 #3
On Mar 28, 4:25 pm, Roger <roger.canti...@gmail.comwrote:
On Mar 28, 3:53 pm, za...@construction-imaging.com wrote:
On Mar 28, 3:29 pm, Roger <roger.canti...@gmail.comwrote:
Hi,
I've implemented a windows service that calls an SSIS package. Every
so often, the SSIS package does not return control to the calling
method. What I've implemented is a sentinel thread that is spawned
before the execute method of the SSIS package which will email me if
execution occurs for a prolonged period. What I want to know is, how
can I implement a solution that will force the SSIS object to timeout
and return control to the calling method in the event handler of the
sentinel thread? Code samples would be appreciated.
Thanks,
Roger
To exit out of a method before it has completed, just do a:
return;

The problem is, the SSIS object retains control due to a deadlocking
issue and doesn't give me the opportunity to return. I need another
method of raising exception from method without stopping the service
outright.
Nevermind. I figured out that I can run through all the running SSIS
packages and shutdown the offending packages.
Mar 28 '08 #4
On Fri, 28 Mar 2008 12:29:35 -0700 (PDT), Roger
<ro************@gmail.comwrote:
>Hi,

I've implemented a windows service that calls an SSIS package. Every
so often, the SSIS package does not return control to the calling
method. What I've implemented is a sentinel thread that is spawned
before the execute method of the SSIS package which will email me if
execution occurs for a prolonged period. What I want to know is, how
can I implement a solution that will force the SSIS object to timeout
and return control to the calling method in the event handler of the
sentinel thread? Code samples would be appreciated.

Thanks,

Roger
Call SSIS in a worker thread. Spawn your sentinel thread. If the
Sentinel thread finishes before the SSIS thread then kill the SSIS
thread from you main thread.

If you are not actually doing anything in your main thread then you
might be able to replace the sentinel thread with a simple timer in
the main thread.

rossum

Mar 28 '08 #5

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

Similar topics

4
by: highway of diamonds | last post by:
a bit of a 'hacker' with javascript but can any one tell me why this code throws up "'exit' is undefined" and how to sort. the code does what I want it to, but hate errors I can't explain. TIA...
1
by: Guinness Mann | last post by:
Pardon me if this is not the optimum newsgroup for this post, but it's the only .NET newsgroup I read and I'm certain someone here can help me. I have a C# program that checks for an error...
10
by: lallous | last post by:
Hello, This question was asked in comp.lang.c++ and the answers involved the use of objects whose destructors are automatically called when getting out of scope, however I was expecting...
1
by: Brendan Miller | last post by:
I am trying to close my application using Application.exit() in the frmMain_Closing event. When the form closes the process does not. My application only has one form (no other classes either). ...
6
by: orekin | last post by:
Hi There I have been trying to come to grips with Application.Run(), Application.Exit() and the Message Pump and I would really appreciate some feedback on the following questions .. There are...
13
by: PeterZ | last post by:
Hi, Back to basics! My understanding is that the only way to exit a For-Next loop prematurely is with the 'break' keyword. How are you supposed to do that if you're inside a Switch...
4
by: Bob Day | last post by:
Using VS 2003, VB.net... I am confused about the Application.Exit method, where the help states "This method does not force the application to exit." Aside from the naming confusion, how do I...
0
by: tngoe | last post by:
echo "" echo "Enter person ID:" read person_id sqlplus -silent '/nolog'<<end_sql1 connect useract/passwd start $BANNER_LINKS/gurlsid.sql $person_id FAISMGR end_sql1 cat person.lst...
2
by: paul138 | last post by:
Hi, I have created an index in Excel that goes up by 1 everytime a macro is run. (cell c99 in Sheet1) I.e. it starts at one, i run the macro and it now shows 2. I wish to add some code to my...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.