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: Fred Strauss <Fred_Strauss at ap dot org>
Subject: Message handler woes
Date: Nov 13 1997 10:23PM

I hope someone can help me with this. I'm using Perl 5.003 with Sybperl
2-07. What I'm trying to do is establish one database handle and
corresponding message handlers for my application. I have the message
handler routines in a separate module:

package SybMsg;

use Sybase::CTlib;

sub sybase_msg_cb {
     .
     .
     .
}

sub sybase_srv_cb {
     .
     .
     .
}

Sybase::CTlib::ct_callback(CS_CLIENTMSG_CB, \&sybase_msg_cb);
Sybase::CTlib::ct_callback(CS_SERVERMSG_CB, \&sybase_srv_cb);
1;

I then in my main perl module have:


use Getopt::Std;
use Cwd;
use integer;
use Sybase::CTlib;
use SybMsg;

# establish Sybase database handle and message handlers
$db_handle = Sybase::CTlib->ct_connect("sa", "sports", $ENV{"DSQUERY"});

as soon as ct_connect is called I get the following:

Open Client Message: (In msg_cb)
Message number: LAYER = (1) ORIGIN = (1) SEVERITY = (1) NUMBER = (50)
Message String: ct_cmd_alloc(): user api layer: external error: The
connection has been marked dead.
ct_cmd_alloc failed at gen_race_reports.pl line 30.

Open Client Message: (In msg_cb)
Message number: LAYER = (1) ORIGIN = (1) SEVERITY = (1) NUMBER = (60)
Message String: ct_con_drop(): user api layer: external error: There is a
usage error.  This routine has been called at an illegal t
ime.
Can't call method "ct_execute" without a package or object reference at
gen_race_reports.pl line 33.

The strange part is if I take out the calls to ct_callback() everything
seems to work fine. Anyone with any ideas or workarounds?

Thanks for a the help.

Fred