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.
Matt Pletcher — — source: Informix-list mailing list archive (1991-1998)
We deal with very high-transaction tables and have hit this problem often
in the past. Here's our workaround for it in our application programs
(native 4gl), using a library function called 'is_locked':
------------------------------------
FUNCTION del_row ()
LET success = false
WHILE TRUE
WHENEVER ERROR CONTINUE
EXECUTE del_stmt USING primary_key
WHENEVER ERROR STOP
IF ( SQLCA.SQLCODE = 0 ) THEN
LET success = TRUE
EXIT WHILE
ELSE
IF is_locked ( SQLCA.SQLCODE ) THEN
LET try_count = try_count + 1
SLEEP 1
IF ( try_count > 20 ) THEN
CALL ungraceful_exit ( SQLCA.SQLCODE )
ELSE
CONTINUE WHILE
END IF
ELSE
CALL ungraceful_exit ( SQLCA.SQLCODE )
END IF
END IF
END WHILE
END FUNCTION
## Put this function in a shared library.
FUNCTION is_locked ( p_sqlcode )
IF ( p_sqlca = -246 OR ## Any sqlca lock error...
p_sqlca = -154 ) THEN
RETURN TRUE
ELSE
RETURN FALSE
END IF
END FUNCTION
-------------------------
Hope this helps with concurrent processing.
Matt Pletcher
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.