Wednesday 8 June 2016

14. Enqueue Work Process

Enqueue Work Process
Commonly there is only one enqueue work process for a single SAP system; however there are circumstances where, for performance reasons, it might be useful to configure up to four enqueue work processes. R/3 note 127773 contains more details about this.
The profile parameter that controls the number of enqueue work processes is: rdisp/wp_no_enq
The locks (enqueues) are managed by the enqueue work process using a lock table which resides in the main memory. When the processes receive a locking request, the enqueue work process verifies whether the requested lock object interferes with other existing entries in the lock table.
The lock objects are special types of objects defined in the ABAP dictionary.
 Type of Lock

Lock mode
Description
Shared lock
S (Shared)
Several users (transactions) can access locked data at the same time in display mode. A request for another shared lock is accepted, even if it comes from another user. An exclusive lock set on an object that already has a shared lock will be rejected.
Exclusive lock
E (Exclusive)
An exclusive lock protects the locked object against all types of locks from other transactions. Only the same lock owner can reset the lock (accumulate).
Exclusive but not cumulative lock
X (eXclusive non-cumulative)
Exclusive locks can be requested several times from the same transaction and are processed successively. In contrast, exclusive but not cumulative locks can be called only once from the same transaction. Each further lock request will be rejected.
Optimistic lock
O (Optimistic)
Optimistic locks initially behave like shared locks and can be converted into exclusive locks
When the lock objects are defined in the dictionary, there are two ABAP function modules automatically generated for them: one to lock the object (enqueue) and another function to unlock it (dequeue). These functions are called at the beginning and at the end of a transaction respectively.
If for some reason there are problems between the locking and unlocking of an object, it remains locked until the administrator manually deletes the lock by using tcode SM12.

No comments:

Post a Comment