Re: ? SET ISOLATION
Posted in 1995
W Mat Waites <ren1347@harriet.rencorp.com> wrote: >xrizzi@arcride.edu.ar writes: >> From different processes is NOT possible to agree to rows NOT selected >>by the CURSOR FOR UPDATE. >> >> The messages error of informix is the following: >> >> - 246 could not I give an indexed read to get next row. >> > >It sounds like you are hitting the "adjacent row key locking" >problem. This is supposedly fixed in 6.0. > >When a row is locked, the row before it and after it is also locked. Well, not exactly. When a row is deleted, the index key value after it (or the next rowid, if the index accepts dups and there is a next rowid) is locked. When a row is inserted, the index key value (or next rowid) is TESTED for a lock. When a row is updated, IF the index key value is updated, then it's treated as a delete and an insert. At no point is the row before it locked. This has been changed in 6.0 and greater versions of OnLine. Also, in 4.11 and 5.01, a change was added to allow adjacent inserts. None of this necessarily explains why the original poster is getting -246 errors. It would be necessary to know: - What rows had been selected with the CURSOR FOR UPDATE - What rows had been updated - What other rows were being (attempted to be) selected - What indexes exist on the table - What ISAM error was returned by the 2nd select For a better description of Adjacent Key Locking, and the changes in 6.0 for Key Value Locking, see the latest TechNotes. Also available on InformixLink, I believe. June ---- June Tong Informix Asia/Pacific ---- ---- On-Loan Engineer Singapore ---- ---- junet@informix.com (65) 298-1716 ----