Re: Recovering from ODBC error without user intervention


Steven Blank
 

Sherm,

Now that you mention it, my old GetLockOwnerName utility is constructed the same way: the actual error event handler is, and apparently must be, defined in the program where the error will occur.

Magic's whole event-driven baby has matured nicely since v9.4, eh?

Steve Blank

At 04:44 PM 1/30/2017, you wrote:
I had tried putting it in a parent of the task which opens the table (with scope subtask) and that didn't work, but putting it in the task which opens the table works fine. I can ignore the error and pass an appropriate error message back to the parent.

Thanks

Sherm

On 01/30/2017 06:17 PM, Steven Blank wrote:
Sherm,

I may be missing some key point, but couldn't you create an error event handler in the Main Program to take appropriate action?

Steve Blank


At 03:02 PM 1/30/2017, you wrote:

A client using M94 is running an online task on an unmonitored workstation. That task has a timer event which runs a series of batch tasks at intervals.

There is occasionally an issue accessing a specific ODBC table, which returns in MGERROR.LOG the text "Error>> Failed to open table....(etc)"

at which point the online task exits but the application remains open.

Is there a good way to recover from this situation?

I suspect I can set up the main program so it relaunches the online task if it doesn't exit "properly", and even to skip the batch task which accesses the ODBC table should that occur (so the remainder of the processes continue to run), however that seems inelegant to me.

Is there a better solution?

Thanks

Sherm






Join main@magicu-l.groups.io to automatically receive all group messages.