The SAP system is equipped with a special lock mechanism that synchronizes access to data on the database. The purpose of the lock mechanism is to prevent two transactions from changing the same data on the database simultaneously.
Locks are defined generically as "lock objects" in the Data Dictionary. A lock entry is a specific instance of a lock object and locks a certain database object, such as a correction entry or a table entry.
Lock entries are usually set and deleted automatically when user programs access a data object and release it again.
The ABAP documentation explains the key elements of the lock concept with regard to programming ABAP transactions in the section entitled The SAP Lock Concept.
The documentation is divided into the following sections:
· SAP Lock Concept describes how the SAP lock works. You have to understand the concepts described here in order to use the SAP locks when you are programming applications.
· Standalone Enqueue Server contains details of the architecture of the standalone server and its use. It is particularly recommended for high availability scenarios. The J2EE Engine uses the Java version of the standalone enqueue server in Central Services.
· Important Profile Parameters for the Lock Concept: here you can find a list of the profile parameters relevant for the lock concept. You can use these parameters to tailor your system resources to your needs.
· Managing Lock Entries describes lock management (transaction SM12), which you use to display, check, and delete lock entries. This may be necessary if the SAP dispatcher, the operating system, or the network connection fails, and the dispatcher cannot delete lock entries. In this case, invalid lock entries remain effective and block access to the locked data when the system is restarted.
· Analyzing and Solving Problems provides information and tips about handling errors.