Unlock AS/400 update file

190 pts.
Tags:
AS/400
What is the best way to unlock the update file when using update program for inquiry only?
1

Answer Wiki

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

If you are getting locks on files with any regularity you may want to write an inquiry only version of program. The other thing we found in some of our code written by an outside vendor using old school coding methods was causing our lock problems. When they were trying to validate a record they were using the CHAIN command. This puts a lock on that record until it’s released. They should have used the CHAIN(N) which does basically the same thing but does not lock the record.

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.
  • BigKat
    If you don't have access to the source, you might have to make the users sign out after using the update program.
    9,460 pointsBadges:
    report
  • GregManzo
    Really your application should be designed to not hold a record lock across a long wait. This means:
    - Chain to the required record
    - Release the lock
    - Display the data on screen, allowing changes if in 'edit' mode
    - If in 'display only' mode or if no changes made, exit program
    - Re-fetch the record
    - Compare to a saved 'before' image to ensure nobody else has changed the same record (go back & show error if so)
    - Update from the 'after' image
    - Trap an I/O error generated by your database trigger
    - If so, go back & show error messages

    And if you are smart you will have most of this in an /INCLUDE member, so you only need to code the exceptions for this particular program.
    2,970 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.

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

Following

Share this item with your network: