Translating with DrWatson… this can take a few seconds the first time.
This is a genuine, complex translation. DrWatson protects commands, error codes, and log output while naturally translating the surrounding text. It’s translated once and saved.
Robert Minter — — source: Informix-list mailing list archive (1991-1998)
From John Wade:
*
* The problem that I am trying to resolve is that using Informix's 4gl
* and trying to lock a table in exclusive mode that is already locked
* by another program. The second program that tries to lock the table
* crashes out of the application back to UNIX.
*
* My question is there any standard way of having a program wait gracefully
* until the another program unlocks the table?. It seems that SET LOCK MODE TO
* WAIt is only for record locking and not table locking.
You need to trap the error and loop until no status is found then lock the
table. Like the following:
WHENEVER ERROR CONTINUE
WHILE TRUE
LOCK TABLE tablename IN EXCLUSIVE MODE
IF STATUS THEN
IF SQLCA.SQLERRD[ 2 ] != -113 THEN
CALL error_handler_routine()
END IF
ELSE
EXIT WHILE
END IF
END WHILE
You could also put a loop counter with a SLEEP statement to bail out of
endless looping.
Robert Minter |Data Systems Support| \\\\\\_///
Programmer, Software Development | Orange, CA | ( _ _ )
internet: rob@dssmktg.com | Tel: 714.771.0454 | (| ^ |)
bangpath: uunet.uu.net!dssmktg!rob| Fax: 714.771.3028 | \\`-'/
#include <disclaimer.h> SURF'S UP \\_/
We use strictly necessary cookies to make this site work. With your
consent we’d also use optional cookies for analytics and marketing. You can accept all,
reject all, or choose. Read our Cookie Policy.