8.4.3 Shallow and Deep Locks

A lock can be specified as either shallow or deep. A shallow lock applies only to its holding node. A deep lock applies to its holding node and all its descendants.

Consequently, there is a distinction between a lock being held by a node and a lock applying to a node. A lock always applies to its holding node. However, if it is a deep lock, it also applies to all nodes in the holding node's subtree. When a lock applies to a node, that node is said to be locked.

Since a deep lock applies to all nodes in the lock-holding node's subtree, this may include both mix:lockable nodes and non-mix:lockable nodes. The deep lock applies to both categories of node equally and it does not add any jcr:lockOwner or jcr:isDeep properties to any of the deep-locked mix:lockable nodes. However, if any such nodes exist and they already have these properties, this means that they are already locked, and hence the attempt to deep lock above them will fail.

Additionally, assuming a deep lock exists above a mix:lockable node any attempt to lock this lower level mix:lockable node will also fail, because it is already locked from above.