Lock avoidance
Concurrency is improved when applications are created so that DB2® can use lock avoidance techniques.

To take the best advantage of this method of avoiding locks, make sure all applications that access data concurrently issue COMMIT statements frequently.
The following figure shows how DB2 can avoid taking locks and the following table summarizes the factors that influence lock avoidance.

| Isolation | CURRENTDATA | Cursor type | Avoid locks on returned data? | Avoid locks on rejected data? |
|---|---|---|---|---|
| UR | N/A | Read-only | N/A | N/A |
| CS | YES | Any | No | Yes1 |
| NO | Read-only | Yes | ||
| Updatable | No | |||
| Ambiguous | Yes | |||
| RS | N/A | Any | No | Yes1, 2 |
| RR | N/A | Any | No | No |
Notes:
- Locks are avoided when the row is disqualified after stage 1 processing
- Under the ISOLATION(RS) option and multi-row fetch, DB2 releases locks on Stage 1 qualified rows
that later fail to qualify for stage 2 predicates at the next fetch
of the cursor.
