Record locking (or lack of it)

pts.
Tags:
Application development
RPGLE
Bare with me a minute before you throw rocks, but is there a difference in record locking between a Chain and Read? Here's what I'm looking at. We have a control file that contains the next note number. In all our applications we either chain or setll/read the control file, get the number, add one to it, and then update the file. Sounds simple and straight forward, but somewhere along the line note are being created with duplicate note numbers. And the only difference I see is some chain to the file and some setll/read.

Answer Wiki

Thanks. We'll let you know when a new response is added.

all such problems have underlying causes in areas where we are not looking. I am sure the record locking is working. The most obvious possible problem is the a) not found condition for the chain, or b) the not eof condition for the read, or c) the misplaced Set Lower Limit. Is there only one record in the control file? if not, the read might be getting the wrong record. Is this the case?

I do not think it is a locking problem.

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
  • DaddyCOZ
    all such problems have underlying causes in areas where we are not looking. I am sure the record locking is working. The most obvious possible problem is the a) not found condition for the chain, or b) the not eof condition for the read, or c) the misplaced Set Lower Limit. Is there only one record in the control file? if not, the read might be getting the wrong record. Is this the case? I do not think it is a locking problem.
    0 pointsBadges:
    report
  • TimRac
    As soon as you get the number for the next note, you should immediately update it. This way the next person who requests the next note number will really get the next note number
    25 pointsBadges:
    report
  • JBurelle
    You know how you can look at something many times and just not see what right in front of you. Well I think I found the problem, some of the programs where getting the number (say 100), using that number, then adding one to it (101) and updating the file. Other programs are getting the number (100), adding one to it (101), using that number, then updating the file. So you could get two users with the number 101. Thanks for your inputs.:)
    0 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