Multiple record locks in a single file.

560 pts.
Tags:
RPGLE
How can I attain multiple and simultaneous record locks in a single file without using commitment control? (...in RPGLE...)

Answer Wiki

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

Normally this is not something you see in a program.
Each logical or physical file used in a RPG program that is marked as Update can hold 1 record lock only, but you can use multiple logical files based on the same physical file and again each logical can hold 1 record lock.
By using multiple logical files you can hold multiple record locks in a single physical file in the same RPG program.

Kevin

Discuss This Question: 2  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
  • bogeybetsy
    I have associated records and there are fields that are the same in these records. It was designed in such a way that when any one of these records is viewed, you will see the same information for the other associated records. Hence, when we update one record, the other records must be updated too to maintain data integrity. However, one user may be updating an associated record while another user is also updating another associated record. And so we have deadlocks... I am searching a way to lock associated records when I attempt to update one of them. I'm stumped...Is commitment control the only elegant way?
    560 pointsBadges:
    report
  • kevleemor
    I understand your issue. A suggestion would be: When the user views a record and it's associated records, load the relevant data into a hold area/data structure. When the user decides to update some information, first retrieve the records again, compare the record data against the hold area data, if the data is different, display a message to the user that the data has changed and show the changed data elements, if there is no difference then update all the files required. Otherwise, Commitment Control is a elegant method to use. Anyways DASD is cheap, right?
    605 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