470 pts.
 Releasing lock in AS/400
how to find which record is locked and who locked that record.how to release the lock by ourselves.please explain in detail.i'm new to as/400.

Software/Hardware used:
ASKED: June 17, 2010  2:59 PM
UPDATED: June 22, 2010  2:30 AM

Answer Wiki:
interactively you would use the command dsprcdlck this will prompt you for the file name you will need to end any jobs that are locking the record in question. Phil
Last Wiki Answer Submitted:  June 17, 2010  11:00 pm  by  philpl1jb   44,070 pts.
All Answer Wiki Contributors:  philpl1jb   44,070 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

how to find which record is locked…

That’s an unusual question since a program usually already knows which record it’s processing. However, you might be asking about SQL mass updates or some similar process that operates on sets of records. Can you explain why you asked?

how to release the lock by ourselves.

That’s easy. Run ENDJOB against the job that has the lock. Unless all of your programs are written to respond to requests from other jobs, ending the job that is holding the lock is your only option.

Tom

 107,755 pts.

 

sir thanks everybody for answering my question.
i still have some doubts,if i’m accessing a record for updating and another user is also trying to access the same record for updating at the same time,that record would be locked no at that time what he shall do to release the lock or has he has to wait till i finish updating,wrkobjlck command what it is used for.thanks gentlemen in advance.

 470 pts.

 

Whenever possible, instead of ending any jobs, locate the record lock user ask them to complete the update and explain what adverse affect it has on the system and other users when a record is left open. Once the record is updated and released for another transaction, you may need to reply to an object lock message if the program(s) requires this. Normally, entering a retry will work but you will want to check with your developer’s for valid replies to ensure successful processes.

We have found that as we educate our users rearding this locking situation, our locking errors have decreased substantially.

 645 pts.

 

Hi…
Is this an interactive job? On interactive jobs… sometimes a developer will not relases a record prior to returnig a display of that record to the enduser. The record is locked… the enduser is in “think time”… not knowing that while he/she is thinking… the record is locking others from updating. The application needs to verify that during the user “think time”… that the record may have been updated. And needs to be redisplayed for verifcation. Make sense?

 460 pts.

 

if i’m accessing a record for updating and another user is also trying to access the same record for updating at the same time,that record would be locked no at that time

That is correct.

what he shall do to release the lock or has he has to wait till i finish updating,

We can’t tell what a user has to do to release a lock because we don’t know what programs are being used. In general, programs would be written to allow some kind of exit or cancellation. Usually, the F12 key would start a cancellation, but that is determined by how the developer wrote the programs.

wrkobjlck command what it is used for.

The WRKOBJLCK command is used when you want to check to see if an object has any locks associated with it. It tells you what kinds of locks have been set and which jobs have those locks. The command isn’t used in programming much. It is generally used by administrators during investigation of problems.

When an RPG program runs into a lock condition, you can retrieve information about the lock from a number of sources. The sources will depend on how you coded the program.

For example, if you coded for a file information data structure (INFDS) and a program status data structure (PSDS), you could check the *STATUS to see if it was ’01218′. You could check the exception data in the PSDS to find out about what job held the lock. That information could be displayed to the user.

A trivial example of one way to catch lock errors (see figure 132)… some information on the file information data structure (INFDS)… and info on the program status data structure (PSDS)

Tom

 107,755 pts.