Re: Update failed question
Posted in 1995
Colonel Panic (aland@informix.com) wrote: : In article <jxxcpj@salmon.demon.co.uk>, : Neil S. Briscoe <Neil@salmon.demon.co.uk> wrote: : >In Article <3lchsj$qlj@ftcnews.nrcs.usda.gov> Tammy Croteau writes: : >[..explanations deleted..] : >>fails : >>$BEGIN : >>for (i=0; i<600; i++) { : >> $UPDATE .... : >>} : >>$COMMIT : >> : > : >With this one, every update causes a lock and you are running out of locks. : >So it bombs. Either, increase your locks or, before that $BEGIN, do a : >$LOCK TABLE FOO IN EXCLUSIVE MODE. : No, *after* the BEGIN. If you do it *before* the begin, and the database : has transactions, the lock will not persist. Each statement not in a BEGIN... Is that true of SE? If you do it before the begin with OnLine DSA you get Error 524 "Lock table can only be used within a transaction". : COMMIT block is a singleton transaction, and the lock clears immediately : after processing the LOCK TABLE statement. In a database with transactions, : [UN]LOCK TABLE therefore has no effect except within a BEGIN. (realistically, : UNLOCK TABLE isn't used, since COMMIT releases the locks anyway). -- graeme -- Disclaimer: The author's opinions are his own, and not necessarily those of Pyramid Technology Ltd. or Pyramid Technology Inc. --------------------------------------------------------------------------- -m------- Graeme Sargent Voice: +44 (0)252 373035 ---mmm----- Senior Database Consultant Fax : +44 (0)252 373135 -----mmmmm--- Pyramid Technology Ltd. Telex: Tell who??? -------mmmmmmm- Farnborough, Hants GU14 7PL Email: graeme@pyra.co.uk --------------------------------------------------------------------------- We have the technology. The tricky bit is learning how to use it.