[freetds] FreeTDS, C++, and Exceptions

Bort, Paul pbort at tmwsystems.com
Sat Jun 17 23:57:40 EDT 2006


The easy answer when you want to keep running no matter what is to start
a child process and wait for it. 
 

> -----Original Message-----
> From: freetds-bounces at lists.ibiblio.org 
> [mailto:freetds-bounces at lists.ibiblio.org] On Behalf Of Lenon Kitchens
> Sent: Saturday, June 17, 2006 1:14 PM
> To: FreeTDS Development Group
> Subject: Re: [freetds] FreeTDS, C++, and Exceptions
> 
> Frediano Ziglio wrote:
> > :( this is bad C++... a C callback implemented in C++ 
> should not throw 
> > exceptions... C do not support unwinding so you are doing something 
> > wrong. You could recompile all FreeTDS using a C++ compiled 
> but code 
> > is not exception safe (cause C do not support exception) so 
> you would 
> > convert a core in leaks... you should save error in a place, and 
> > outside FreeTDS detect this error and throw exception.
> >
> > bye
> >   freddy77
> >   
> That was actually my first solution.  The problem with it is 
> that sometimes after calling the callback functions FreeTDS 
> calls abort() and never returns control to my library.  This 
> is absolutely unacceptable.  
> Because my library is actually loaded and used by TCL code 
> that doesn't necessarily fail after a bad SQL execution, I 
> must eventually return control to the TCL script in every 
> scenario.  Therefore, saving an error (an exception in my 
> case) and throwing it after the FreeTDS call that caused an 
> error is unreliable at best.
> 
> Any other solutions to this problem?
> 
> Thanks,
>   Lenon
> _______________________________________________
> FreeTDS mailing list
> FreeTDS at lists.ibiblio.org
> http://lists.ibiblio.org/mailman/listinfo/freetds
> 


More information about the FreeTDS mailing list