3.1.4.2.2.1.3.42.1 Columns

The DISCOVER_LOCKS rowset contains the following columns.

Name

Type

Restriction

Description

SPID

xsd:int

Yes

The session ID.

LOCK_ID

uuid

The unique identifier of the lock, as a GUID.

LOCK_TRANSACTION_ID

uuid

Yes

The unique identifier of the transaction, as a GUID.

LOCK_OBJECT_ID

xmlDocument

Yes

The unique identifier of the object being locked.

LOCK_STATUS

xsd:int

Yes

The lock status.

  • 0 - The system is waiting to lock the object.

  • 1 - The lock is granted.

LOCK_TYPE

xsd:int

Yes

A bitmask of lock types.

  • LOCK_NONE (0x0000000) - No lock.

  • LOCK_SESSION_LOCK (0x0000001) - Inactive session; does not interfere with other locks.

  • LOCK_READ (0x0000002) - Read lock during processing.

  • LOCK_WRITE (0x0000004) - Write lock during processing.

  • LOCK_COMMIT_READ (0x0000008) - Commit lock, shared.

  • LOCK_COMMIT_WRITE (0x0000010) - Commit lock, exclusive.

  • LOCK_COMMIT_ABORTABLE (0x0000020) - Abort at commit progress.

  • LOCK_COMMIT_INPROGRESS (0x0000040) - Commit in progress.

  • LOCK_INVALID (0x0000080) Invalid lock.

LOCK_CREATION_TIME

xsd:dateTime

The UTC server time at the moment the lock was requested.

LOCK_GRANT_TIME

xsd:dateTime

The UTC server time at the moment the lock was granted on the resource.

The rowset is not sorted.

The response has the following definition.

       <xsd:element name="root">
         <xsd:complexType>
           <xsd:sequence minOccurs="0" maxOccurs="unbounded">
             <xsd:element name="row" type="row" />
           </xsd:sequence>
         </xsd:complexType>
       </xsd:element>
       <xsd:simpleType name="uuid">
         <xsd:restriction base="xsd:string">
           <xsd:pattern value="[0-9a-zA-Z]{8}-[0-9a-zA-Z]{4}-[0-9a-zA-Z]{4}-[0-9a-zA-Z]{4}-[0-9a-zA-Z]{12}" />
         </xsd:restriction>
       </xsd:simpleType>
       <xsd:complexType name="xmlDocument">
         <xsd:sequence>
           <xsd:any />
         </xsd:sequence>
       </xsd:complexType>
       <xsd:complexType name="row">
         <xsd:sequence>
           <xsd:element sql:field="SPID" name="SPID" type="xsd:int" minOccurs="0" />
           <xsd:element sql:field="LOCK_ID" name="LOCK_ID" type="uuid" minOccurs="0" />
           <xsd:element sql:field="LOCK_TRANSACTION_ID" name="LOCK_TRANSACTION_ID" type="uuid" 
                            minOccurs="0" />
           <xsd:element sql:field="LOCK_OBJECT_ID" name="LOCK_OBJECT_ID" type="xmlDocument" 
                            minOccurs="0" />
           <xsd:element sql:field="LOCK_STATUS" name="LOCK_STATUS" type="xsd:int" 
                            minOccurs="0" />
           <xsd:element sql:field="LOCK_TYPE" name="LOCK_TYPE" type="xsd:int" minOccurs="0" />
           <xsd:element sql:field="LOCK_CREATION_TIME" name="LOCK_CREATION_TIME" 
                            type="xsd:dateTime" minOccurs="0" />
           <xsd:element sql:field="LOCK_GRANT_TIME" name="LOCK_GRANT_TIME" type="xsd:dateTime" 
                            minOccurs="0" />
         </xsd:sequence>
       </xsd:complexType>