Skip to main content

LCKW

Short Description

The job is waiting for a lock (for example a record lock held by another job).

Detailed Description​

The job is waiting for a lock on an object or a record that another job holds. In Db2 for i this is most often a row (record) lock held by another job that has updated the row and has not yet committed, or a job that has a file open in a way that conflicts with the request.

How to reduce this wait​

  • Enable Collect Blocking Sessions for the instance, and use the Blocking Sessions tab to find the job holding the lock and the SQL it ran. The DBmarlin user profile needs *JOBCTL special authority to find blockers of other users' jobs; see Db2 for i blocking sessions.
  • Commit or roll back transactions as soon as possible so that row locks are held for a short time.
  • Check the isolation level (commitment control) of the applications. A higher isolation level holds more locks for longer.
  • Look for jobs that hold locks while waiting for something else, such as a reply to a message (MSGW) or user input.
  • WRKOBJLCK or QSYS2.RECORD_LOCK_INFO show the locks on a file.

IBM i docs - ACTIVE_JOB_INFO table function

IBM i docs - JOB_LOCK_INFO table function

Search online​

If this article doesn't have the information you need you can try searching online. Remember, you can contribute suggestions to this page.