z/OS DFSMStvs Planning and Operating Guide
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Avoiding false lock contention

z/OS DFSMStvs Planning and Operating Guide
SC23-6877-00

Real contention occurs when two units of recovery are trying to lock the same record if the key length is 16 bytes or less. However, if the key length is more than 16 bytes, VSAM or VSAM RLS locks a hashed value of the key.

While the example shown in Figure 1 is not an accurate flow of hashing, it provides an example to help you understand how false contention can happen. The example shows how the hash table would look (17-byte keys) if the key is hashed by just taking the last 16 bytes.
Figure 1. Example of key hashing.
KEY                            HASH  
18888888888888888              8888888888888888 
18888888888888885              8888888888888885 
28888888888888885              8888888888888885

The first two keys have different hash values but the last two have the same value. If UR1 is accessing key 18888888888888885 and UR2 tries to access key 28888888888888885, UR2 gets an indication that it has contention with UR1. Since they are trying to lock different records, this is false contention. The program would treat it as a real contention, back out the unit of recovery and try again.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014