
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 .
You can obtain a TableLocking instance using the following code:
Context initialContext = new InitialContext();
TableLocking locking = (TableLocking) initialContext.lookup(TableLocking.JNDI_NAME);
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: