|
|
sybperl-l Archive
Up Prev Next
From: "Rybacki, Jim" <jrybacki at citistreetonline dot com>
Subject: Trying to cycle through ~150 Servers -ct_con_alloc failed
Date: Sep 12 2002 4:08PM
I could use some help here.
Specifics:
OS : HP/UX 11.0
Perl : 5.005_03
Sybperl :sybperl-2.14
CT-LIB : Sybase Client-Library/11.1.1/P-EBF8061
Sybase : 11.0.0.3 -> 11.9.2
The problem:
I'm trying to cycle through approximately 150 Sybase
servers on seperate machines in order collect information.
After about 4 interations of the server loop I receive the
following error:
ct_con_alloc failed at Server.pm line 69.
Server.pm (code snippet)
In an attemp to catch the sybase warning (?) for 'connection to two
endpoints failed'
I placed the following in my callback procedure and try to catch it
with an eval on the
new (ct_connect) command.
Server.pm
Callback routine:
...
if ( $severity = 5 && $number=3 ){
die "Server unreachable\n";
}
Repos new (server object)
Line 69 eval { local $SIG{'__DIE__'} ; $dbh = new Sybase::CTlib
$user, $PWD , $server_name, $appname } ;
if ( $@ || ! defined ($dbh) ) {
print "a=$@\n";
return (0);
}
$obj = { _dbh => $dbh, # Database Handle
_user => $user, # User name
_name => $server_name }; # Server name
bless $obj;
return ($obj)
Server.pm (end)
ping.pl
@servers=get_server_list();
foreach (@servers){
$Server=$Repos->new(......);
if ( ! $Server ){
..... } update server down state
else {
Repos->close($Server) ( which does a
CT_CLOSE on the dbh - does this work?).
}
ping.pl (end)
The UNIX box has 20GB of memory so I don't this is a memory problem (per
CTLIb man). I've
looked at the CTLIb.c code, RTFM, and tried many combos of this -to no
avail.
I was under the impression that once a dbh goes out of scope that the
resources
are released.(??)
Anyway, I would really like to get loop this to work (not just for a ping).
Does anyone have a suggestion ?
Thanks in advance,
Jim Rybacki
Citistreet
Sybase DBA
Ph: 904.791.2900
Fax: 904.791-2169
E-Mail: jrybacki@citistreetonline.com
|