IBM 000-8697 Server User Manual


 
System Architecture 2-61
How a User Process Acquires a Buffer
Step 1: Identify the Data
OnLine user processes request a specific data row by rowid. (Refer to
page 2-123 for a definition of rowid.) OnLine translates the logical rowid into
a physical page location. The user process searches for this page.
Step 2: Determine Lock-Access Level
Next OnLine determines the level of lock access required by the requesting
user process: share, update, or exclusive. (Refer to page 2-38 for further infor-
mation about buffer locks.)
Step 3: Locate the Page in Memory
The user process first attempts to locate the requested page in shared
memory. To do this, it tries to acquire a latch on the hash table associated with
the buffer table. If the process can acquire the latch, it searches the hash table
to see if an entry matches the requested page. If it finds an entry for the page,
it releases the latch on the hash table and tries to acquire the latch on the
buffer header entry in the buffer table.
With access to the buffer header, the requesting process adds its user process
ID to the user list bit map for the buffer and increments the shared-user count
by 1.
The user process tests the current lock-access level of the buffer.
If the levels are compatible, the requesting user process gains access to the
buffer. If the current lock-access level is incompatible, the requesting process
puts itself on the user wait list of the buffer. The buffer state, unmodified or
modified, is irrelevant; even unmodified buffers can be locked.
For further information about the entry stored in the buffer table, refer to
page 2-48.