Retrieve Lock Space Locks (QTRXRLSL) API


  Required Parameter Group:


  Default Public Authority: *USE

  Threadsafe: Yes

The Retrieve Lock Space Locks (QTRXRLSL) API generates a list of objects that have been locked or that have lower level locks held by the specified lock space. Locks that are being waited for on behalf of a lock space are not returned. Use the Retrieve Job Locks (QWCRJBLK) or Retrieve Lock Information (QWCRLCKI) API to retrieve locks that are being waited for by a thread on behalf of a lock space.


Authorities and Locks

Job Authority
The caller of the API must be running under a user profile that has job control (*JOBCTL) special authority.

Required Parameter Group

Receiver variable
OUTPUT; CHAR(*)

The receiver variable that receives the information requested. You can specify the size of the area to be smaller than the format requested as long as you specify the length parameter correctly. As a result, the API returns only the data that the area can hold. For example, this may mean that the number of locked object entries available in the receiver variable do not match the value in the number of locked object entries returned.

See Format of Receiver Information for details on the format of the receiver information.

Length of receiver variable
INPUT; BINARY(4)

The length of the receiver variable provided. The length of the receiver variable parameter may be specified up to the size of the receiver variable specified in the user program. If the length of the receiver variable specified is larger then the allocated size of the receiver variable specified in the user program, the results are not predictable. The minimum length is 8 bytes.

Format of receiver information
INPUT; CHAR(8)

The format of the information returned in the receiver variable. The format name is:


Lock space identifier
INPUT; CHAR(20)

The identifier of the lock space for which record locks are to be returned.

Lock filters
INPUT;CHAR(*)

Filters used for the lock information that is returned. See Format of Lock Filters for further information.

Format of lock filters
INPUT; CHAR(8)

The format of the lock filters used on the returned data. The format name is:


Error code
I/O; CHAR(*)

The structure in which to return error information. For the format of the structure, see Error code parameter.


Format of Receiver Information

The format of the information returned in the receiver variable.


RLSL0100 Format

This format is used to return objects and members that are locked. For detailed descriptions of the fields in the table, see Field Descriptions for RLSL0100 Format.



Each locked object returned will have the following structure.



Field Descriptions for RLSL0100 Format

Bytes available. The number of bytes of data available to be returned. All available data is returned if enough space is provided.

Bytes returned. The number of bytes of data returned. Only complete entries are returned.

Extended object attributes. The extended attributes of an object. Extended attributes further describe the object. For example, an object type of *PGM may have a value of RPG (RPG program) or CLP (CL program). This field will be blank if there is no extended attribute associated with the object type.

Extended object name. The name of the object that is locked. If the lock is on a database member, the object name is the name of the file that owns the member to which the lock applies. If the member lock type is member or access path, the file that owns the member may be either a physical file or a logical file. If the member lock type is data, the file that owns the member is a physical file. The following special value also may be returned:

Length of locked object entry. The length of each locked object entry.

Lock count. The number of identical locks on this entity.

Lock request handle. A handle to lock request information. Using the Retrieve Lock Request Information (QWCRLRQI) API and passing in this handle, you can retrieve additional information about the program that requested this lock. A value of hexadecimal zero is returned when additional information cannot be retrieved. This value is a temporary value that can expire. See Retrieve Lock Request Information (QWCRLRQI) API for additional information.

Lock state. The lock condition for the lock request. Lower level locks are returned and can occur when a member of a file is locked, but the file itself is not locked. Possible other values are:

Lock status. The status of the lock request. Possible values are:

Member locks. The number of member locks for a database file. If the object is not a database file, 0 is returned.

Member lock type. If the lock is on a member, this field indicates the type of member lock; otherwise, it is blank. Possible values are:

Member name. The name of the member that has a lock held or waiting on it. If the type of entity is not a member object, this field is blank. The following special value also may be returned:

Number of locked object entries available. The number of locked object entries that are held by this lock space.

Number of locked object entries returned. The number of locked object entries that are returned.

Object ASP name. The name of the auxiliary sptorage pool (ASP) that contains the object that is locked. The following special values also may be returned:

Object ASP number. The numeric identifier of the ASP containing the locked object. The following values may be returned:

Object library ASP name. The name of the ASP containing the library of the locked object. The following specials value also may be returned:

Object library ASP number. The numeric identifier of the ASP containing the library of the locked object. The following values may be returned:

Object library name. The name of the library containing the locked object. This field will be blank if the type of entity is an internal system object or is an internal system object space location. The following special value also may be returned:

Object lock handle. An identifier that can be input to Retrieve Lock Information (QWCRLCKI) API to find additional information about other holders of locks on this object. A value of hexadecimal zero is returned when additional information cannot be retrieved. The object lock handle is a temporary value that can expire. See the QWCRLCKI API for additional information.

Object type. The object type. For a list of all the available external IBM i object types, see the Control language topic collection.

Offset to list of locked objects. The offset in bytes from the beginning of the receiver variable to the first entry.

Reserved. An unused field.

Type of entity. A value that identifies the type of entity for which the lock information is returned. The following values may be returned:

Format of Lock Filters

The format of the lock filters used on the returned lock information.


RLSF0100 Format

The following information is to be specified for the RLSF0100 format. For detailed descriptions of the fields in the table, see Field Descriptions for RLSF0100 Format.



Field Descriptions for RLSF0100 Format

Filter lock state. Filters information that is returned so that it only contains information about locks that have a certain lock state. The default is do not filter on lock state value.

Filter object library ASP name. The name of the library's auxiliary storage pool (ASP) on which to filter. A special value of *SYSBAS can be specified. A blank field will cause no filtering to be done on this field. The default is to not filter on this field.

Filter object library name. This is the library name on which to filter. A blank field will cause no filtering to be done on this field. The default is to not filter on this field.

Filter object name. Only locks on the specified object are returned. In the case of database files, members of the file also may be returned. A blank field will cause no filtering to be done on this field. The default is to not filter on this field.

Filter size. The size of the filter information passed. Valid values are:

Include internal system objects flag. A value of 1 in this field allows internal system object locks to be returned. A value of 0 causes these values to be excluded from the return data. The default is to exclude internal system objects.

Include lock space objects flag. A value of 1 in this field allows lock space objects locks to be returned. A value of 0 causes these values to be excluded from the return data. The default is to include lock space objects.

Include member objects flag. A value of 1 in this field allows member objects locks to be returned. A value of 0 causes these values to be excluded from the return data. The default is to include member objects.

Include IBM i external objects flag. A value of 1 in this field allows IBM i external object locks to be returned. A value of 0 causes these objects to be excluded from the return data. The default is to include IBM i external objects.

Include unknown types flag. A value of 1 in this field allows locks that are of an unknown entity type to be returned. A value of 0 causes these values to be excluded from the return data. The default is to exclude unknown types.

Reserved. An unused field.


Error Messages



API introduced: V5R2

[ Back to top | Work Management APIs | APIs by category ]