How Db2 tracks interest
The mechanism that Db2 uses to express interest in an object is a global lock called a physical lock (P-lock).
These locks are physical
in contrast to transaction locks,
sometimes called logical locks
(L-locks). The level of P-lock
that tracks Db2 read/write interest
is a page set P-lock. There are also page P-locks, which serve
another role.
Although you do not have as much control over physical locks as over transaction locks, P-locks play an important part in how Db2 tracks inter-Db2 interest.
Page set P-lock operations occur on each member, and reflect that member's level of interest in a page set. Even if only one data sharing member is active, page set P-lock operations still occur. The following table shows when those operations occur on each member.
| Event | Page set P-lock operation |
|---|---|
| Page set or partition data sets are physically opened. | Page set P-lock is obtained in a read-only state. |
| Page set or partition is first updated. | Page set P-lock is changed to a read-write state. |
| No update was done within an installation-specified time period or number of checkpoints (read-only switching). | Page set P-lock is changed to a read-only state. |
| Page set or partition data sets are closed. | Page set P-lock is released. |
- A single member with read/write interest and any number of members with read-only interest exist.
- All members have read-only interest and the page set or partition has been GBP-dependent since the time it was physically opened.
When those conditions occur and the page set is defined with CLOSE YES, Db2 physically closes the page set or partition to remove the inter-Db2 read/write interest for any read-only members that do not reference the page set or partition again in a certain amount of time. The amount of time is at least the value of the PCLOSET subsystem parameter, but it can be up to twice the value of PCLOSET.