Re: SET LOCK MODE TO WAIT ?
Posted in 1995
In article <3u6bq4$e99@cssun.mathcs.emory.edu>, jparker@hpbs3645.boi.hp.com wrote: > [snipped] >> Can anyone confirm or deny that a wait period can be specified as a >> parameter to SET LOCK MODE TO WAIT and if so, what is the default? >> > >My 4gl 4.0 manual on page 7-223 documents SET LOCK MODE TO [NOT] WAIT. It >gives no indication of a time you can set it to. I would imagine that this >is an engine level command and not restricted to the front end tool. I >would also imagine that the default amount of time to wait would be that >which was set up for the engine when it was initialized under >'Deadlock Timeout' under the Shared Memory parameters. > >cheers >j. > [snipped] Which is why you want to wait until the last possible moment to lock the table for update. I've programmed both ways depending on the situation: method a: lock table, edit buffer, press ESC, update table method b: edit buffer. press ESC, lock table ( declare cursor for upd ), if success -->update table I've deferred to method b: in my latest code crank, bas_4gl1, which is now available in my tool kit inx_util 3.0. Latest release is at my home page. It probably could be refined a bit more, but is very functional. ( method a: is still in mk_4gl1, so you can see the difference. ) The advantage to method b: is that if the update is not possible, you are not hung up waiting for the table to get freed. I've noticed even when a user frees up an update with method a:, the selected set can still keep the table locked, until the program is actually terminated. Only after the program ends can user b could go into the same row and do an update. This could also be platform specific, but method b: offers the least amount of overhead. If the user aborts, a save buffer restores the screen and all is as before. Tim -- \\\\|// (O|O) ==============================---o00--(_)--00o---============================ Tim Schaefer tschaefe@gate.net http://www.gate.net/~tschaefe People who don't make anything cain't buy anything...never forget that. -HRP =============================================================================