Introduction to the Collision Check mechanism of SAP ABAP Lock

The SAP ABAP system uses the Collision Check mechanism to check whether a lock request conflicts with an existing lock.

In the event of a conflict, the user of the dialog transaction receives a message indicating that the requested object is currently locked by a different user.

NOTE: For non-conversational workers (in bulk input), the lock request is issued again later.

The description of the collision check mechanism in SAP official documents :

There are two steps when checking if a lock request collides with an existing lock: First, the system checks if the lock request collides with an elementary lock in the lock table. If this is the case, the system checks if there is an owner collision. (The same owner may, for example, request a write lock more than once. This is described in Lock Cumulation.)

It can be seen that the collision check process is divided into two steps.

  1. elementary lockThe system checks whether the lock request conflicts with those in the lock table .

  2. If there is indeed a conflict, check whether the current lock request has an owner collision with the entry in the lock table.

The reason for checking owner collision is that the same owner may submit write lock requests repeatedly.

In the event of a conflict, the user of the dialog transaction receives a message indicating that the requested object is currently locked by another user.

For non-dialogue workers (in bulk input), the lock request is issued again later.

We say two Elementary Locks are in conflict if all of the following conditions are met:

  1. The name of the base lock (the table being locked) is the same.

  2. Lock parameters: The lock parameters are the same. The letters at each position are matched (here the wildcard letter denoted by @ is the same for all letters).

  3. At least one base lock is not read locked.

The following figures are some specific examples.

The third lock request, because the request is a read lock, and the lock table is also a read lock, so there is no lock conflict.

In the fourth line, there is already a read lock S in the lock table. At this time, trying to acquire a write lock, E, will fail.

Guess you like

Origin blog.csdn.net/i042416/article/details/132254933