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: "Wechsler, Steven M" <WechslerSM at bernstein dot com>
Subject: Detecting hanging server?
Date: May 26 1998 2:58PM

Greetings,

	I'm about to convert a Perl script to Sybperl (it's currently
communicating with Sybase via ISQL; somewhat clunky, as you can
imagine).  Occasionally we have a problem whereby a connection to the
SQL server hangs up (sometimes due to tempdb being full, sometimes due
to other causes).  The only way I was able to detect it using ISQL was
to run it (the ISQL process) in the background with fork() (writing the
output to a file) and wait()ing a few seconds for the subprocess to
finish.  If it didn't finish in the allocated time, I would assume the
process was hung, kill it, and send out an appropriate error message.

	I'd like to avoid this fork()ing if at all possible.  What is
the best way, using any Open Client functions, to detect a hanging
server command/session?

Thanks,

Steve
--
Steven Wechsler/Sybase DBA/Sanford C. Bernstein & Co., Inc.
WechslerSM@bernstein.com 
"Never underestimate the power of human stupidity" - Lazarus Long
Support the Anti-SPAM amendment: http://www.cauce.org