Show TOC

Releasing Locks with the LogicalLocking APILocate this document in the navigation structure

Use

In certain cases, problems can result in locks that cannot be released again. For example, a program may terminate prematurely and leave pending locks behind. You can monitor and remove unreleased locks manually. For more information, see Managing Locks .

To release locks explicitly in the program code, you call the unlock() method from the LogicalLocking interface. It releases selected locks owned by the invoking transaction in the corresponding namespace. There are several unlock() signatures. For example, to unlock one or several objects of the same type:

Sample Code
               public void unlock(byte lifetime,
                   java.lang.String name,
                   java.lang.String argument,
                   char mode,
                   boolean asynchronous)
            throws               com.sap.engine.frame.core.locking.TechnicalLockException,
                   java.lang.IllegalArgumentException

            

The parameters of unlock()method have the same semantics as the parameters of the lock() method. By default, releasing locks may execute asynchronously. For each unlock() method there is an optional Boolean parameter asynchronous , which specifies whether the lock can also be released asynchronously. By setting the value to false , you enforce the synchronous mode. In all other cases, the profile parameter settings of the Enqueue Server are valid.

For more information, see the JavaDoc available with the SAP NetWeaver Developer Studio help for the com.sap.engine.services.applocking and com.sap.engine.frame.core.locking packages.