Record locked by the same job

20 pts.
Tags:
AS400 RPGLE
Here's the case where my program does several Read operations on a single file at different places. At one of the READ statements it throws error that the record is already locked to this Job. Apparently it would have got locked in one of the other READ operations, but is there a way I can find which previous READ operation locked the job. I tried looking at the dump but it has the last operation, file & statement as the one where the error has occurred.

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Discuss This Question: 3  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • JohnD2
    Maybe try using STRDBG on your program and add a breakpoint at each of your READs. When you get to it, do a WRKJOB and see what the relative record is on the file. This should help you find where it is getting locked.  You could do a conditional breakpoint so you don't have to break for every record.
    15 pointsBadges:
    report
  • philpl1jb

    For this to happen

    - you have more than one access path (logical) and both paths have update capability.  Easiest fix .. only use one access path

    - you have commitment control active. .. actually this option seems unlikely.

    - you've called the same program twice and the first time it didn't update the record, unlock the record, or close the file or turn on *inlr on exit.

    49,960 pointsBadges:
    report
  • ToddN2000
    If you are getting a record lock I would check your CHAIN op codes. If you are chaining just to validate a record and not going to actualy do an update to the record use the chain with no lock op code CHAIN(N). Other that that I'd try and debug your logic flow around the statement number that is giving the error message..
    11,245 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following