Timeout on locks
Posted in 1992
John R. Carter Sr. writes: > > [ ... Jonathan Leffler saying "wait for a lock" ... ] > > I concur with this concept. Still, the effort to correctly > implement a wait on a request to lock a record should be able to > identify the difference between a program/machine glitch and the > fact that the record has already been taken by another process. Sorry, I don't really understand the above. Wouldn't like to elaborate a little, would you ? I thought a prog/machine glitch would rollback the failed process and therefore clear the locks. > Timers to timeout after some reasonable period of time while > waiting on a lock request aren't built in to Informix. Is it not possible to use the deadlock timeout for this kind of stuff ? > Therefore > it's not possible to use the Informix tools with 100% certainty > and I'm still forced to use a ESQL-C program with > multi-processing ( fork a timer routine) to interrupt the wait > on a lock request process just in case the whole thing went out > to lunch when I made the request. If you want to do this, how about using alarm(3C) to set the timeout, and using a signal handler for SIGALRM ? Should be easier than forking, cos you can do it all in the one process. > The main problem I find with writing applications is that I'm > not given the extra time needed to build in error trapping > techniques from the start. I'm sure this same mode was beset the > authors of 4GL and SQL else all this concern over how to handle > errors wouldn't seem to be an after-the-fact catch up. Um, do they ever give you the time to test & document them properly, either ? I always seem to have to go from a "back-of-an-envelope-sketch" to a [roughly-]working application in the amount of time it takes to write the prototype. Strange, innit ? :-) :-) > Am I on track with this view? Yup, and the other one, that Informix-Link could reasonably be provided free once you've paid the maintenance fees. > John R. Carter, Sr. Programmer/Analyst - Informix DBA > Computer Sciences Corporation jcarter@nas.nasa.gov > Numerical Aerodynamic Simulation 415/604-3662 > NASA Ames Research Center, Moffett Field, CA 94035-1000 M/S 258-6 All the best. Cheers - Tony. __________________________________________________________________________ Tony Heskett th@bnr.co.uk Voice: (+44) 279 402637 BNR, London Road, Harlow, Essex, CM17 9NA Fax: (+44) 279 451434