PEPPLER.ORG
Michael Peppler
Sybase Consulting
Menu
Home
Sybase on Linux
Install Guide for Sybase on Linux
General Sybase Resources
General Perl Resources
Freeware
Sybperl
Sybase::Simple
DBD::Sybase
BCP Tool
Bug Tracker
Mailing List Archive
Downloads Directory
FAQs
Sybase on Linux FAQ
Sybperl FAQ
Personal
Michael Peppler's resume

sybperl-l Archive

Up    Prev    Next    

From: Michael Ellery <mellery at yahoo dot com>
Subject: Re: CT-lib Error halts script
Date: Mar 18 1999 3:48PM

My message handler (client callback) looks like:

-------------------------------------------------
sub _messageHandler {
  my ($layer,$origin,$severity,$number,$msg,$osmsg)=@_;

  my $out = "\nCT-lib error: Msg->$msg\nLayer->$layer Origin->$origin
Severity->$severity\n"      if ( $msg   ne "" );
  $out    = "\nCT-lib error: OSmsg->$osmsg\nLayer->$layer
Origin->$origin Severity->$severity\n"  if ( $osmsg ne "" );

  if ($severity > 0) {
    
    if ($cmDb::Logging) {
      # Call the specified logging routine by reference
      &{$cmDb::LogSub}($out);
    }
    &setClientMsg($out);
  
  }
  
  return CS_SUCCEED;

} # End of _messageHandler
-------------------------------------------------

..which I think is OK.

I am finding, upon further investigation, that the script appears to
halt the NEXT time that it tries to establish a connection to the DB
after one failed with the message below.  That is, if I get this
message once, then I appear to get stuck the next time I try to do a
ct_connect().  By the way, I am using a little home-grown package to
handle the DB connection and other CTlib calls...the heart of the
new() method there is just:

-------------------------------------------------
  my $dbh=Sybase::CTlib->ct_connect($user, $password, $server, $0);
  return undef if (($dbh < 0) || (! $dbh)); # Get out if not
successful..
-------------------------------------------------

Does that seem reasonable?  I've looked in the Sybperl docs and I
guess I'm not entirely sure what to expect back from ct_connect() if
there is a problem...

Thanks,
Mike Ellery


---Michael Peppler  wrote:
>
> Michael Ellery writes:
>  > Folks-
>  > 
>  > I periodically get the following error from CT-lib when I try to
>  > establish a connection:
>  > 
>  > ------------------------------------------
>  > CT-lib error: Msg->ct_connect(): network packet layer: internal net
>  > library error: Attempt to use invalid address handle Layer->5
>  > Origin->3 Severity->4
>  > ------------------------------------------
>  > 
>  > (as you can see, I have a callback handler to grab these messages.)
>  > 
>  > The message itself isn't such a problem but be script basically
stops
>  > dead whenever I get such a message.  It doesn't die and it doesn't
>  > proceed--it just stops.  
> 
> What does your client callback return?
> 
> The callbacks MUST return CS_SUCCEED. Other values will most probably
> cause the script to exit.
> 
> Michael
> -- 
> Michael Peppler         -||-  Data Migrations Inc.
> mpeppler@peppler.org    -||-  http://www.mbay.net/~mpeppler
> Int. Sybase User Group  -||-  http://www.isug.com
> Sybase on Linux mailing list: ase-linux-list@isug.com
> 
> 

==
*-------------------------------------------*
* Michael Ellery                            *
* mellery@yahoo.com                         *
*-------------------------------------------*              

_________________________________________________________
DO YOU YAHOO!?
Get your free @yahoo.com address at http://mail.yahoo.com