Re: Who holds a lock ?
Posted in 1994
>From: tony@bilpin.co.uk (Tony Desborough) >Subject: Who holds a lock ? >Date: Thu, 17 Feb 1994 17:00:37 GMT >X-Informix-List-Id: <news.5587> > >Is there any way in 4GL (or otherwise) to establish which user >holds an update lock on a record, when another person's attempt >to update the same record fails ? Effectively, the answer is No. With OnLine, you could go poking around in DIRTY READ mode for the ROWID of the row which is locked, and the PartNum from SysTables for the table, and use these to examine the output from tbstat -ku to identify which user had the lock. With OnLine 6.0, you could probably achieve the same effect through the SMI facility (SysMaster database). The amount of work involved is probably not worth the trouble. With SE, you'd have a much harder time; again, you'd need to know the ROWID, but your problems only start there. You'd need to use fcntl() on the base C-ISAM file (which leads to permissions problems somewhere down the line), and you'd need to know where to go to test the lock for a row -- it isn't at the offset where you'd find the row unless someone's changed the locking scheme since I last looked at the code -- and then you'd have to have a way of mapping process ID to user. Yours, Jonathan Leffler (johnl@informix.com) #include <disclaimer.h>