Up Prev Next
From: "Todd E dot Scheresky" <tscheresky at micron dot com>
Subject: Re: Dead connections
Date: Dec 12 1997 4:58PM
Michael Peppler wrote:
> Todd E. Scheresky wrote:
> > Greetings,
> > This question IS NOT for the faint of heart. First some background. I
> > am running Perl 5.004_04, Sybperl 2.07, on AIX 4.1.3. The Perl script,
> > extremely bastardized, follows at the end of this email.
> > I run the script in two ways. First, from the command line and second,
> > I call the subroutine "resolveIP" repeatedly from a C program.
> Do you just call the subroutine, or do you call the script repeatedly?
I call the subroutine repeatedly as described in the Perl 5.004 documentation
( perlembed ). Incidentally, "getIP" originally went against DNS and didn't
use Sybperl and at that time there were no issues.
> > From the C program the script runs
> > fine on the first call to "resolveIP". However, if I call "resolveIP" a
> > second time, and repeatedly thereafter, on the first host "getIP" dies
> > because ct_execute returns a CS_FAIL. It's as if the database
> > connection to Sybase is no longer valid.
> Do you get any other message from the client callback?
The following message was passed back to the C program: execute:
sel_TCPIP_address_by_alias returned CS_FAIL during global destruction.
> > to longer than 60 seconds and ct_config failed with the following error.
> > I used "ct_config(CS_SET, CS_LOGIN_TIMEOUT, 900);" I got back:
> > Open Client Message: (In msg_cb)
> > Message number: LAYER = (1) ORIGIN = (1) SEVERITY = (1) NUMBER = (9)
> > Message String: ct_config(SET,LOGIN_TIMEOUT): user api layer: external
> > error: The buflen parameter must be set to CS_UNUSED.
> You need to add a CS_INT_TYPE parameter to your ct_config() call.
I tried what you suggested and I received the following message from the
client callback: Too many arguments for Sybase::CTlib::ct_config at resolveIP
line 115, near "CS_INT_TYPE)".
> > So what the heck is happening here? Why can I only run "resolvedIP"
> > successfully once?
> Strange. Based on what you specify the script should run fine.
> A small point though - you are passing \$dbh as parameter to getip().
> THat is not necessary, as $dbh is already a reference.
Suggestion noted... Thanks
> Michael Peppler -||- Data Migrations Inc.
> email@example.com -||- http://www.mbay.net/~mpeppler