Show TOC

Background documentationWorking with the TableLocking API Locate this document in the navigation structure

 

To set locks on table rows, you use the TableLocking API. The Application Locking Service provides instances of the TableLocking API using JNDI. The TableLocking API is defined by the interface com.sap.engine.services.applocking.TableLocking; the JNDI name is contained in the constant TableLocking.JNDI_NAME.

Example Example

You can get a TableLocking instance using the following code:

  1. Context initialContext = new InitialContext();
    TableLocking locking = (TableLocking) initialContext.lookup(TableLocking.JNDI_NAME);
    
End of the code.

Locks are used in the context of transactions and connections. For all operations, the corresponding connection has to be transferred to the table-locking methods. For more information about how to obtain a connection, see Getting a Connection to the Database.

For more information, see:

Setting Locks with the TableLocking API

Releasing Locks with the TableLocking API