Skip to Content.
Sympa Menu

freetds - RE: [ freetds-Patches-575613 ] Do not use global ms- g/err handlers

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Brian Bruns" <camber AT ais.org>
  • To: freetds AT franklin.oit.unc.edu
  • Subject: RE: [ freetds-Patches-575613 ] Do not use global ms- g/err handlers
  • Date: Mon, 1 Jul 2002 14:47:08 -0400


> > > At this point I'd remove connection_list from TDSCONTEXT, add pointer
> > > for
> > > msg/err handler
> > >
> >
> > Can't remove the connection list. The be compatible with the API dbexit()
> > must close all open database connections, so we are required to store the
> > list of open connections somewhere. cs_ctx_drop() and SQLFreeEnv()
> > probably should exhibit the same behaviour, but currently don't. The big
> > problem here is that the maintenance of the connection list is not
> > thread-safe, we'd need to control access via a mutex of some sort. I'm
> > happy to take patches on this one from anybody interested in threading.
> >
>
> This not true. dblib call itself all function to update the list, so
> connection_list stuff can be moved to dblib.
>
> freddy77

Ok, splitting hairs. You can move the connection list, but you may not
*remove* it. ;-)

Seriously though i just looked up the behaviour of cs_ctx_drop() and it
should be returning CS_FAIL if any open connections exist. So either you
maintain a connection list in both dblib and ctlib (technically you could
reference count it here) or maintain a common one.

ODBC also should return SQL state 'S1010' indicating that connections are
open. So, again that could be reference counted, but do we really want to
have code for tracking connections in three different places?




Archive powered by MHonArc 2.6.24.

Top of Page