Re: C-ISAM Locking
Posted in 1998
On Fri, 16 Oct 1998, Robin Grayson wrote: > I have written a utility in c on unix that will show all locked records in a > C-ISAM file. This has worked a treat, until we upgraded to C-ISAM 5. > > The program now returns with no lock information. How has the locking > changed in C-ISAM from version 3 to 5+ ? > > I am using fcntl() on the UNIX machine to check for locks, with a locking > table offset of 0x40000000L - is this what has changed ? if so what has it > changed to ? It may have changed but I doubt it. I know that once upon a very long time ago, I had to change the locking base on a port of the old Informix 3.30 C-ISAM from the 1 GB (0x40000000) default value to half that value because locking stopped working at 1 GB (this was on a very old HP-UX; I think it was HP-UX 8.x, but it might have been still older). Why don't you lock record 1 in a C-ISAM file using the C-ISAM calls, and then open the data file through normal Unix open() and then use fcntl to determine where the locks in the range 0..0x7FFFFFFF are? I think you can do that with a fcntl() call with the F_GETLK command and an flock structure with l_whence = SEEK_SET, l_start = 0, l_len = 0x7FFFFFFF, l_type = F_WRLCK applied to the file descriptor (not the ISAM file descriptor) of the .dat file. Yours, Jonathan Leffler (jleffler@informix.com) #include <witticism.h> Guardian of DBD::Informix v0.60 -- http://www.perl.com/CPAN Informix IDN for D4GL & Linux -- http://www.informix.com/idn