Do you really want to lock the row, or do just need to insure that no one else has modified the row since you last read it? R:base has added a feature to the database engine that adds an extra col to the table called sys_rowver that is a computed col and everytime the row is updated, it incrimints the counter. When you read a row of data, you also pick this up, and then when you get ready to write your changes back to the row, check the counter and make sure the sys_rowver has not changed.
If your database supports computed columns, you could manually add a sys_rowver col to all of your tables. The formula is (IFNULL((SYS_ROWVER+1),0,(SYS_ROWVER+1))) Troy Sosamon ===== Original Message from [EMAIL PROTECTED] at 6/10/02 12:59 pm >While looking through the Web Application and Construction Kit, they had a >section on Row locking while trying to update a value. They assign to the >locked column a 1 to lock it. Only one problem, isn't it theoretically >possible that some one else could be doing a "Locking" update on the same >row. > >Ex > >User1: Search => Finds row 10 unlocked >User2: Search => Finds row 10 unlocked >User1: Since Row 10 unlocked lock row 10 By updated the locked column to 1 >on the Locked row >User2: Since Row 10 unlocked lock row 10 By updated the locked column to 1 >on the Locked row > >When we move to the more robust and multithreaded Witango 5 the above >locking scheme may not work. Wouldn't it be better to use the ><@USEREFERENCE> to truly lock the Row? >This way when the final update is done it is compared with the ><@USERREFERENCE> since it is unique? > >Any Ideas? > >Jose > >-- >Webologies >150 Robinette Drive >Waynesville, NC 28786 >828.627.1994 > >http://www.webologies.com > >---------------------------------------------------------------------------- >"You can't make an omelet without breaking eggs" Boris Badenov >---------------------------------------------------------------------------- > >________________________________________________________________________ >TO UNSUBSCRIBE: send a plain text/US ASCII email to [EMAIL PROTECTED] > with unsubscribe witango-talk in the message body ________________________________________________________________________ TO UNSUBSCRIBE: send a plain text/US ASCII email to [EMAIL PROTECTED] with unsubscribe witango-talk in the message body
