Skip to Content.
Sympa Menu

freetds - Re: [freetds] FreeTDS, C++, and Exceptions

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Lenon Kitchens <lenonk AT sanctuary.org>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] FreeTDS, C++, and Exceptions
  • Date: Sat, 17 Jun 2006 13:13:54 -0400

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




Archive powered by MHonArc 2.6.24.

Top of Page