Show TOC Start of Content Area

Background documentation Releasing Locks with the TableLocking API  Locate the document in its SAP Library structure

Besides the automatic release of locks at the end of a transaction, locks can also be released manually by using the method unlock lock of the interface TableLocking:

Syntax

public void unlock(byte lifetime,

               Connection connection,

               String tableName,

               Map primaryKeys,

               char mode)

               throws TechnicalLockException,

                    IllegalArgumentException;

 

The parameters have the same meaning as those for setting locks. You can use the unlockAll method to release all set locks:

Syntax

public void unlockAll(byte lifetime)

                 throws TechnicalLockException,

                      IllegalArgumentException;

 

For each of these methods there is an overloaded method with an additional booleanparameter asynchronous, which specifies whether the lock can also be released asynchronously. By transferring the value false, the synchronous mode is forced. Otherwise, the profile parameter settings of the enqueue server are valid here.

 

Note

We recommend that you use transactional locks (locks with a lifetime of the transaction). These locks are automatically released at the end of the transaction. Nontransactional locks with the lifetime of the user session are automatically released at the end of a UserSession (at the latest, when the user session times out).

 

 

End of Content Area