Easily Respond to Object and Record Lock Events

So, your nightly backup or other important job is running and BOOM, a message arrives on the QSYSOPR message queue that the job has encountered a record allocation or object allocation error, because some other job is holding a lock on the record or the object you need. You do a WRKOBJLCK (Work with Object Locks) command to see who has it, and send the offending user a message or terminate the offending job so the important job can run.

The following command will do all this for you. The Process Object Locks (PRCOBJLCK) command identifies all jobs currently holding a lock for the specified object. For each job, it either sends a break message or ends the job. The break message is sent to the jobs holding the lock or optionally to all jobs currently running under the user profile of the jobs holding the lock.

Download the save file containing the source code.

Read the entire article

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s