Error handling in a batch processor

The forum to discuss the Headless version of Servoy. Web, Java and Servlet development questions can all be posted here.

Error handling in a batch processor

Postby amcgilly » Tue Jun 10, 2008 2:14 am

I have written a batch processor that is monitoring a port and continuously processing packets. It has happened on occasion that after making changes/upgrades to the code, it has run into a programming error and stopped running. I was hoping I could use an error handler to get it to recover from the error, but so far it hasn't worked.

First I tried an error handler that just reported the error to a log. After reporting the error, it just stopped running.

Next I tried having the error handler restart the solution using closeSolution(solution_to_open, parameters), but this doesn't seem to work for batch processes - an un-named headless client is started (shows up in the admin console with no name) that doesn't appear to be doing anything.

Next I may try using Scott Buttler's Robot plugin to close and restart the batch process.

Any thoughts/ideas are much appreciated. Thanks.
Adrian McGilly
Servoy Developer

Image
amcgilly
 
Posts: 375
Joined: Fri Dec 09, 2005 12:03 am
Location: San Francisco, CA

Postby sdevlin » Tue Jun 10, 2008 5:26 pm

Hi Adrian,

Are you running your code inside of a try/catch block or deferring the handling to onErrorHandler ?
Sean Devlin
Servoy USA
sdevlin
 
Posts: 125
Joined: Tue Apr 13, 2004 3:33 am

Postby amcgilly » Tue Jun 10, 2008 10:06 pm

I'm just putting code in a globals.onError method which is specified as the On Error method in the solution settings.

If I'm not mistaken, try/catch blocks work when you know ahead of time what lines of code you think might fail. If that's correct, then that's not really so useful to me in this case. I just want to make the batch processor keep chugging even after it runs into an error (any error), because chances are the error is related to one of hundreds of ongoing communication sessions, and there is no need to stop all comm sessions just because one of them has run into trouble.
Adrian McGilly
Servoy Developer

Image
amcgilly
 
Posts: 375
Joined: Fri Dec 09, 2005 12:03 am
Location: San Francisco, CA


Return to Servoy Headless Client

Who is online

Users browsing this forum: No registered users and 7 guests