Subject Re: [IBO] Connection Lost in a TThread and NT Service, exception handling
Author Jason Wharton
I may have to look at a sample app (simple as possible) in order to get what
is going wrong here.
I really don't know what you are missing.
You should set a flag when an exception is raised and not take action right
in the OnError event.
If you take immediate action to resolve the error you are doing it in a
callstack that will go on to complete a Post event that is now way out of
context.

Jason Wharton
CPS - Mesa AZ
http://www.ibobjects.com

-- We may not have it all together --
-- But together we have it all --


----- Original Message -----
From: "Arno Garrels" <arno.garrels@...>
To: <IBObjects@yahoogroups.com>
Sent: Tuesday, November 05, 2002 1:07 AM
Subject: [IBO] Connection Lost in a TThread and NT Service, exception
handling


>
> Hi,
>
> NT Service with IBO in a worker TThread.
> I just want to terminate a worker thread when IB connection was lost
and/or
> an ISC exception was raised.
> It works fine when I raise my own test exceptions but after the onPost
error
> exception for example I end up in procedure:
> TIB_Connection.FreeStmtHandleCache
> where I get alot of exceptions with message 'This is a potential problem
> Errno: 335544721' until application either terminates or keeps hanging in
> the worker thread.
>
> DB stuff runs in a try finally block. Finally is the last job in execute
> method where database/datasets are closed, datamodule is freed and a
> ThreadMessage is posted to the service thread, in it's handler I do
WaitFor
> and free the worker thread.
> I use IBODataset components with AutoCommit enabled, Protocol TCP/IP.
>
> What am I missing?
>
> Thanks
> Arno Garrels