What is the method to determine which user has a specific record locked from RPGLE?
Unconfigured Ad Widget
Collapse
Announcement
Collapse
No announcement yet.
Determine which user has a specific record locked from RPGLE?
Collapse
X
-
If you're looking to find the user locking a record you are trying to access from within the program that is trying to read the record, look at this article:
You can also look at the system data structure to find the error message and parse out the user locking the record.
Comment
-
From RPGLE, can check %status after CHAIN
/free
chain mykey myfile;
if %status = 1218; // 1218 = record locked
/end-free
You can also use CL command DSPRCDLCK to see if someone has record locked. From the help text:
The Display Record Locks (DSPRCDLCK) command allows you to show the current record lock status of a particular database physical file member. This command displays the lock status for a particular relative record number, or the lock status of all locked records in
the member.
Comment
Comment