Materialize Data Space Record Locks (MATDRECL)


Op Code (Hex) Operand 1 Operand 2

032E Receiver Record selection template

Operand 1: Space pointer.

Operand 2: Space pointer.

Bound program access

Built-in number for MATDRECL is 49. MATDRECL ( receiver : address record_selection_template : address )

Description

The locks currently allocated on the specified data space record are materialized.

The current lock status of the data space record identified by the template in operand 2 is materialized into the space identified by operand 1.

The record selection template identified by operand 2 must be 16-byte aligned. The format of the record selection template is as follows.

Offset
Dec Hex
Field Name
Data Type and Length
0 0
Record selection
Char(24)
0 0
Data space identification
System pointer
16 10
Record number
UBin(4)
20 14
Reserved
Char(4)
24 18
Lock selection
Char(1)
24 18
Materialize data space locks held
Bit 0



0 = Do not materialize
1 = Materialize


24 18
Materialize data space locks waited for
Bit 1



0 = Do not materialize
1 = Materialize


24 18
Reserved
Bits 2-7
25 19
Template options
Char(1)
25 19
Format for number of locks
Bit 0



1 = Use Bin(4) for number of locks
0 = Use UBin(2) for number of locks


25 19
Reserved
Bits 1-7
26 1A
Reserved
Char(6)
32 20
--- End ---

The data space identification must be a system pointer to a data space.

The record number is a relative record number within that data space. If the record number is zero then all locks on the specified data space will be materialized. If the record number is not valid for the specified data space a template value invalid  (hex 3801) exception is signaled.

Both of the fields specified under lock selection are bits which determine the locks to be materialized. If the materialize data space locks held is materialize, the current holders of the specified data space record lock are materialized. If the materialize data space locks waited for is materialize, process information is materialized for any thread contained in the process that is waiting to lock the specified data space record.

The format for number of locks bit determines the format of the number of locks held and number of locks waited for fields in the materialization template. If the bit is set to binary 1 then Bin(4) counts are used, else Bin(2) counts are used.

The materialization template identified by operand 1 must be 16-byte aligned. The format of the materialization is as follows:

Offset
Dec Hex
Field Name
Data Type and Length
0 0
Materialization size specification
Char(8)
0 0
Number of bytes provided for materialization
Bin(4)
4 4
Number of bytes available for materialization
Bin(4)
8 8
Materialization data (2 possible formats)
Char(8)









If format for number of locks bit=1


8 8
Number of lock held descriptions
Bin(4)
12 C
Number of lock waited for descriptions
Bin(4)
16 10
--- End of bit=1 ---




If format for number of locks bit=0


8 8
Number of lock held descriptions
UBin(2)
10 A
Number of lock waited for descriptions
UBin(2)
12 C
Reserved
Char(4)
16 10
--- End of bit=0 ---

16 10
Lock held descriptions
[*] Char(32)



(repeated number of lock held descriptions times)


16 10
Lock holder
System pointer
32 20
Record number
UBin(4)
36 24
Lock state
Char(1)



Hex 30 = DLWK (Database lock weak) lock state
Hex C0 = DLRD (Database lock read) lock state
Hex F8 = DLUP (Database lock update) lock state

All other values are reserved.



37 25
Lock holder information
Char(1)
37 25
Lock scope object type
Bit 0



0 = Process control space
1 = Transaction control structure


37 25
Lock scope
Bit 1



0 = Lock is scoped to the lock scope object type
1 = Lock is scoped to the thread


37 25
Reserved
Bits 2-7
38 26
Reserved (binary 0)
Char(2)
40 28
Thread ID
Char(8)
* *
Lock waited for descriptions
[*] Char(32)



(repeated number of lock waited for descriptions times)


* *
Process control space
System pointer
* *
Record number
UBin(4)
* *
Lock state requested
Char(1)



Hex 30 = DLWK (Database lock weak) lock state
Hex C0 = DLRD (Database lock read) lock state
Hex F8 = DLUP (Database lock update) lock state

All other values are reserved.



* *
Lock waiter information
Char(1)
* *
Lock scope object type
Bit 0



0 = Process control space
1 = Transaction control structure


* *
Lock scope
Bit 1



0 = Lock is scoped to the lock scope object type
1 = Lock is scoped to the thread


* *
Reserved
Bits 2-7
* *
Reserved
Char(2)
* *
Thread ID
Char(8)
* *
--- End ---

The first 4 bytes of the materialization identify the total number of bytes provided for use by the instruction. This value is supplied as input to the instruction and is not modified by the instruction. A value of less than 8 causes the materialization length invalid  (hex 3803) exception to be signaled.

The second 4 bytes of the materialization identify the total number of bytes available to be materialized. The instruction materializes as many bytes as can be contained in the area specified as the receiver. If the byte area identified by the receiver is greater than that required to contain the information requested, the excess bytes are unchanged. No exceptions are signaled in the event that the receiver contains insufficient area for the materialization, other than the materialization length exception described previously.

The number of lock held descriptions contains the number of locks held. A system pointer to the lock holder (the object that holds the lock), the relative record number which is locked, and the lock state are materialized in the area identified as lock held descriptions. The lock holder can be either a process control space (PCS) or a transaction control structure. The object type is determined by the value of the lock scope object type field. When lock scope has a value of lock is scoped to the thread, the thread ID field identifies the thread that holds the lock. Otherwise it is set to binary 0. These fields contain data only if materialize data space locks held is materialize.

The number of lock waited for descriptions contains the number of locks being waited for. A system pointer to the process control space (PCS) for each thread waiting for a lock, the relative record number, and the lock state which the thread is waiting for are materialized in the area identified as lock waited for descriptions. The process control space and the thread ID fields will identify the thread that is waiting for the lock, regardless of the lock scope value. These fields contain data only if materialize data space locks waited for is materialize.

A database weak record lock is only acquired thread-scoped and it only conflicts with update record locks which are thread-scoped to a different thread. The weak record lock does not conflict in any other situation.

If UBin(2) fields are requested for the number of lock held descriptions and number of lock waited for descriptions, then the maximum number that can be returned in each count is 32,767. If the actual number is greater than 32,767 for a number then that number will be set to 32,767, only the first 32,767 locks will be materialized and no exception will be signaled.

Authorization Required

Lock Enforcement

Exceptions

06 Addressing

08 Argument/Parameter

0A Authorization

10 Damage Encountered

1A Lock State

1C Machine-Dependent

20 Machine Support

22 Object Access

24 Pointer Specification

2E Resource Control Limit

32 Scalar Specification

36 Space Management

38 Template Specification

44 Protection Violation