3.1.4.3.2.1.1.16 Lock

The Lock command locks an object in the context of the current transaction.<371>

   <xsd:complexType name="Lock">
     <xsd:all>
       <xsd:element name="ID">
         <xsd:simpleType>
           <xsd:restriction base="xsd:token">
             <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:element>
       <xsd:element name="Object" type="ObjectReference" />
       <xsd:element name="Mode" >
         <xsd:simpleType>
           <xsd:restriction base="xsd:string" >
             <xsd:enumeration value="CommitShared" />
             <xsd:enumeration value="CommitExclusive" />
           </xsd:restriction>
         </xsd:simpleType>
       </xsd:element>
     </xsd:all>
   </xsd:complexType>

Element

Default value

Description

ID

[Required]

The lock ID.

Object

[Required]

The object to be locked. The ObjectReference type is defined in section 3.1.4.3.2.1.1.1.

Mode

[Required]

An enumeration that specifies the type of locking to apply. The possible values are:

  • CommitShared - A shared lock is established on the specified object.

  • CommitExclusive - An exclusive lock is established on the specified object.

The return result type for the Lock command is xmla-e:emptyresult.