|
I've very recently gotten into the habit of using
Commitment control . . . . . . . . . . . . . . : *NONE
Close SQL cursor . . . . . . . . . . . . . . . : *ENDMOD
Hoping it would no longer leave certain files locked when I do simple
statements like:
select substr(a.upaccd,10,5), a.uptext into :EmpNum, :UserText
from userlist a
where a.upuprf=:USERNAME
However it does on occasion. This same program and this same sql. I did
some reading on *ENDMOD and came up with:
*ENDMOD: SQL cursors are closed and SQL prepared statements are implicitly
discarded when the module is exited. LOCK TABLE locks are released when
the first SQL program on the call stack ends.
Then I thought, "Aha, sometimes I execute this program from somewhere
below another SQL program in the call stack and that is what the issue
is". So I created a simple sqlrpgle program:
/DEFINE DSpec
D TEST s 10a
D qcmd pr extpgm('QCMD')
/UNDEFINE DSpec
C/EXEC SQL
C+ Set Option
C+ Naming = *Sys,
C+ Commit = *None,
C+ UsrPrf = *User,
C+ DynUsrPrf = *User
C/END-EXEC
C/EXEC SQL
C+ Select adfile into :test
C+ from acctdel
C+ where adfile='APTRAN'
C/END-EXEC
/free
qcmd();
*inlr=*on;
return;
/end-free
But, when I execute the qcmd() and try calling my test program it doesn't
leave it locked.
What do I have to do, wait until it locks again and see if that program
does something differently?
Isn't there some (expletive deleted) way to have the program that locks
the table in the first place not lock the table? Yo! I'm done with it!
V5R2
cume=TL03077
WRKPTFGRP
PTF Group Level Status
SF99519 47 Installed
SF99502 6 Installed
SF99271 7 Installed
SF99190 10 Installed
SF99169 8 Installed
SF99149 3 Installed
SF99148 3 Installed
SF99098 8 Installed
SF99085 3 Installed
SF99039 2 Installed
Rob Berendt
--
"They that can give up essential liberty to obtain a little temporary
safety deserve neither liberty nor safety."
Benjamin Franklin
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.