[freetds] FeeTDS 0.60 getting killed in continuous operation

Castellano, Nicholas Nicholas_Castellano at acml.com
Tue May 6 15:29:45 EDT 2003

According to the Sybase documentation, "for environments requiring dbinit(),
the application must not make any other DB-Library calls after calling

Your program violates this restriction.  You should only call dbinit() once
at the beginning, and call dbexit() once at the end.


-----Original Message-----
From: freetds-bounces at lists.ibiblio.org
[mailto:freetds-bounces at lists.ibiblio.org] 
Sent: Tuesday, May 06, 2003 1:22 PM
To: freetds at lists.ibiblio.org
Subject: [freetds] FeeTDS 0.60 getting killed in continuous operation


I am connecting through the FreeTDS 0.60 to a SQL Server 2000 machine. I
don't do anything but just dbinit() and dbexit() in a continuous operation
and it fails after sometime (~ 5-10mins). I am attaching the sample code -
please let me know what could possibly go wrong.




#include <stdio.h> 
#include <sqldb.h> 
#include <time.h> 

// Forward declarations of the error handler and message handler. 
int err_handler(DBPROCESS*, int, int, int, char *, char *); 
int msg_handler(DBPROCESS*, DBINT, int, int, char *, char *, 
                char *, DBUSMALLINT); 
int run(); 

int main() { 
    time_t t1; 
    printf("Start Time=%ld\n", (t1=time(&t1))); 
    while (1) run(); 
int run() 
    // Initialize DB-Library. 
    dbinit (); 
    dbexit (); 
    return 1; 

int err_handler (DBPROCESS *dbproc, int severity, 
    int dberr, int oserr, char * dberrstr, char * oserrstr) 
    printf ("DB-Library Error %i: %s\n", dberr, dberrstr); 
    if (oserr != DBNOERR) 
        printf ("Operating System Error %i: %s\n", oserr, oserrstr); 
    return (INT_CANCEL); 

int msg_handler (DBPROCESS *dbproc, DBINT msgno, int msgstate, 
    int severity, char * msgtext, char * server, 
    char * procedure, DBUSMALLINT line) 
    printf ("SQL Server Message %ld: %s\n", msgno, msgtext); 
    return (0); 

FreeTDS mailing list
FreeTDS at lists.ibiblio.org http://lists.ibiblio.org/mailman/listinfo/freetds

The information contained in this transmission may contain privileged and
confidential information and is intended only for the use of the person(s)
named above.  If you are not the intended recipient, or an employee or agent
responsible for delivering this message to the intended recipient, any
review, dissemination, distribution or duplication of this communication is
strictly prohibited. If you are not the intended recipient, please contact
the sender immediately by reply e-mail and destroy all copies of the
original message. Please note that we do not accept account orders and/or
instructions by e-mail, and therefore will not be responsible for carrying
out such orders and/or instructions.

More information about the FreeTDS mailing list