Unconfigured Ad Widget

Collapse

Announcement

Collapse
No announcement yet.

Determine which user has a specific record locked from RPGLE?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Determine which user has a specific record locked from RPGLE?

    What is the method to determine which user has a specific record locked from RPGLE?

  • #2
    From the command line you could use the WRKOBJLCK command. Once this has been entered, you may drill down to the member locks. This screen will tell you the relative record number of the specific record that has been locked.

    Dave

    Comment


    • #3
      Determine which user has a specific record locked from RPGLE?

      There is an API to return object locks to a program - QWCLOBJL

      Regards
      Jørn Nielsen

      Comment


      • #4
        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


        • #5
          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

          Working...
          X