AS/400: RCDLCK and OBJLCK difference?

Tags:
AS/400
Can anyone explain to me the what the difference is between RCDLCK and OBJLCK?


Software/Hardware used:
Software
1

Answer Wiki

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

A RCDLCK basically when the system locks 1 record in a file from use. A user may have a record displayed for update on their screen. When the exit the screen it will release the record lock. 

An OBJLCK is when the system locks an entire file (or other object)  from use by other jobs. This is frequently done with files when performing backups to prevent failures.. It may also happen when a program tries to get data from a data area, like the next sequential order#, Lock the data area, retrieve the data, update with the new number then release the lock.

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.
  • Splat
    A record lock is when a record in a file is locked (usually for update purposes). An object lock is when an object is locked - this is often accomplished with the ALCOBJ command and there are various allocation states that can be put in place.
    12,915 pointsBadges:
    report
  • TheRealRaven
    There doesn't seem to be a technical problem to solve here. What is solved by knowing the difference? Since neither term, "RCDLCK" nor "OBJLCK", actually exists in the system, it's not clear what you're asking.

    Most likely you're wanting to know the difference between a 'record lock' and an 'object lock'. The basic answer would be that a record lock is a lock applied against a record in a database file (or, a row in a table), and an object lock is a lock applied against an object.

    It can be confusing first because a 'lock' doesn't necessarily imply sole usage. For example, any number of jobs might have locks established against the same object at the same time.

    Also, object locks can be chosen and explicitly set and released, while record locks are almost exclusively set and released by the system behind the scenes. Further, there are levels of object locks, while record locks are essentially simply set or not set.

    But why do you need to know?
    36,145 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: