Re: isrecnum bug in C-ISAM
Posted in 1992
In article <1653@das13.snide.com> dave@das13.snide.com (Dave Snyder) writes: >In article <1992Apr13.034933.2354@luga.latrobe.edu.au>, lhscmc@latrobe.edu.au (Craig Macbride) writes: >> When you read ISNEXT or ISPREV (with ISSKIPLOCK) and get a return code >> indicating that the record is locked, you know that isrecnum is junk, but >> the data returned is correct. Therefore, issue a read ISEQUAL on the key >> which the ISNEXT/ISPREV read returned. This second read will return not >> only the correct data, but also the correct isrecnum! > >Why not use ISCURR? I believe that ISCURR reads the record where the >file pointer is pointing regardless of what is in isrecnum. Also, this >method would work on Unique and Duplicate indexes (it'd be quicker too). You'd have hoped that it would work, wouldn't you? Yep, it's the first thing I tried, and guess what? When you use ISNEXT and get isrecnum left unchanged from the previous call, and you then use ISCURR (and the record is still locked by someone) ... isrecnum is _still_ not updated! The ISEQUAL read is the only way I can find of getting isrecnum updated in these circumstances. (ISLAST and ISFIRST also set isrecnum correctly in all instances as far as I can tell, but they are not useful very often! :-() -- _--_|\\ Craig Macbride <lhscmc@luxor.latrobe.edu.au> / \\ <s900387@minyos.xx.rmit.oz.au> \\_.--.*/ v