record lock in procedure module

sharkdim

Member
hi Guy,

when i ran the program ,i found the code_mstr table has been locked in the procedure module,
who can tell me ,how to auto release the record lock, or have another way to settle this issue except "release code_mstr".

if you want to test ,please copy and save the source code as xxbb.p
and one terminal is running xxbb.p in qad mfg/pro ,not exit
and open another terminal to run xxbb.p in mfg/pro ,you will find the code_mstr has been locked by .....




/*Source code*/
{mfdtitle.i}
define variable dd as character format "X(20)" initial "cc".
define variable cc as character format "X(20)" initial "bb".
define variable ee as character format "X(20)" initial "dd".
define variable logical_temp as logical.

repeat:
update cc label "fldname" colon 20
dd label "value" colon 20
ee label "cmmt" colon 20
with frame a side-label .
run xx.
end.

procedure xx.
find first code_mstr where code_domain = global_domain and code_fldname = cc and code_value = dd no-error.
if not available code_mstr then do:
create code_mstr.
assign code_domain = global_domain
code_fldname = cc
code_value = dd.
end.
assign code_cmmt = ee.
end procedure.
 

TomBascom

Curmudgeon
Add "define buffer code_mstr for code_mstr." right after the "procedure xx" line.

This will prevent the scope of code_mstr from leaking out to the main block and correct the problem.
 
Top