Subject Re: [IBO] Multithreaded application problem
Author Robert martin
Hi Helen

Thanks for you points about the exception handling. I will certainly look into some exception handling around the connection, which makes me wonder if perhaps the problem is that it is not connecting here (will test). In the main loop all subroutines are exception handled, so it should be safe.

Seems like I am doing IB stuff ok so my problem may be somewhere else and showing itself on the table connect.

Thanks for your comments on the code, peer review is a good tool :)

Rob Martin
Software Engineer

phone 03 377 0495
fax 03 377 0496
Wild Software Ltd
----- Original Message -----
From: Helen Borrie
Sent: Wednesday, October 27, 2004 5:41 PM
Subject: Re: [IBO] Multithreaded application problem

There are a few of things her that I'm dubious about.

One is your using the Connected property to connect to the database and
providing no exception checking on whether the connection was made. I'd
want to call Connect inside a try...except block and do a really thorough
cleanup if the thread fails to make the connection.

With that in mind, since you have no apparent "exit-and-cleanup" strategy
in the preceding code that is likely to cause the thread owner to terminate
the thread, that "while Terminated = False" loop looks pretty hairy. An
improperly handled exception inside this method (whatever it is) risks
throwing it into an infinite loop, from what I can tell here.


[Non-text portions of this message have been removed]