Up Prev Next
From: "Wechsler, Steven M" <WechslerSM at bernstein dot com>
Subject: Detecting hanging server?
Date: May 26 1998 2:58PM
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
Steven Wechsler/Sybase DBA/Sanford C. Bernstein & Co., Inc.
"Never underestimate the power of human stupidity" - Lazarus Long
Support the Anti-SPAM amendment: http://www.cauce.org