Hi Family.
My current client seems to be doing something strange in their web-based application servers. First the intuitive way I would do it at first instinct:
If DEADLCK_TIMOUT (spelling?) is set to 60 seconds, it seems perfectly legit for my own database access to be set with
set lock mode to wait 5
. that way, if a SELECT or DELETE is taking more than 5 seconds I would get the "unable to position" error.
A long discussion with one of the programmers indicates the app servers seem to be doing something else. Disclaimer on his behalf: It is a commercial product and AFAIK he has no access to the source code. The suspicion is that the app server is setting an internal timer (likely with setjump() and longjump() calls) as a timeout mechanism. Thus, if a DELETE takes more than that 5 seconds (or whatever they set it to) and it is not complete by then, it repeats the DELETE.
My reaction to this theory is horror: "But the lock(s) set in the process of the stalled DELETE are still in place!"
The symptom that led to said long discussion was that there are deadlock errors happening a lot. Unless some internal engine behavior has changed over the past few years, any lock lasting longer than DEADLCK_TIMOUT gets flagged as a deadlock, even when it's just a long-lasting lock.
Is it possible for a session to be locked out of a row when that the session had itself set that very lock?
My next question regards a way to avoid that possibility: If I come out of the timer and the operation is still pending, is there a way to abort that operation? I vaguely recall seeing such an option but I'm not sure if that was in an Informix manual or another. And how to address which operation to abort in an asynchronous environment that may have many pending operations? That seems to be another conundrum.
Ideas, anyone?
------------------------------
Jacob Salomon (Concise is my middle name - NOT :-)
---
Nobody goes there anymore, it's too crowded. --Attr: Yogi Berra
------------------------------
#Informix