freetds AT lists.ibiblio.org
Subject: FreeTDS Development Group
List archive
Re: Proper procedure for logging in and out multiple times
- From: "Brian Bruns" <camber AT ais.org>
- To: freetds AT franklin.oit.unc.edu
- Subject: Re: Proper procedure for logging in and out multiple times
- Date: Wed, 3 Jul 2002 12:32:56 -0400
I applied a patch with some mem leak cleanups in it yesterday...or the day
before. Is your snapshot version older than that?
Brian
> I have an application using the freetds C-API that needs to have a
> non-persistant connection to a MS-SQL 7.0 Server. I have configured freetds
> to use TDS v4.2, and I have tried both version 0.53 and the latest snapshot.
>
> This application is a manufacturing systems control program and it must use
> a non-persistant connection, as machine operators can shut power off at any
> time (no, they really shouldn't, but they do), orphaning open connections to
> the SQL server. Using the code examples in the unittest directory, I
> constructed a package with non-persistant behaviour for this purpose. I
> have been experiencing a memory leak with my application, however; and after
> careful and thorough debugging traced it back to the tds_login(),
> tds_connect(), tds_free_socket(), tds_free_login() function group.
>
> I modified t0001.c to log in and out multiple times.
>
> This is the main() function from my modified unit test.
>
> int main()
> {
> TDSLOGIN *login;
> TDSSOCKET *tds;
> int ret;
> int verbose = 0;
> int i = 0;
> while( i++<1000 )
> {
> fprintf(stdout, "%s: Testing login, logout\n", __FILE__);
> ret = try_tds_login(&login, &tds, __FILE__, verbose);
> if( ret != TDS_SUCCEED )
> {
> fprintf(stderr, "try_tds_login() failed\n");
> return 1;
> }
>
> try_tds_logout(login, tds, verbose);
> }
> return 0;
> }
>
> Is there some clean-up call that I need to make for this code to be
> re-usable? The unit test code leaks exactly the same memory as my
> application. I have verified my own memory operations by commenting out the
> freetds function calls in my object and running the same loop on my code,
> new'ing and delet'ing every time. It doesn't leak.
>
> Thank you in advance for your help,
>
> Dave Coleman
> Software Engineer
> TI Automotive - Meriden, CT
> dColeman AT us.tiauto.com
-
Proper procedure for logging in and out multiple times,
Coleman, Dave, 07/03/2002
- <Possible follow-up(s)>
- Re: Proper procedure for logging in and out multiple times, Brian Bruns, 07/03/2002
Archive powered by MHonArc 2.6.24.