Locking records in extended APIs

You can lock a record in a custom table when executing a custom entity API in Service Definition Framework (SDF).

To lock a record, you must pass the SelectMethod attribute as part of the input XML to the custom entity API. The locking happens within the transaction boundary of the custom API call.

The value of the SelectMethod attribute will determine what (if any) type of locking to be used. You can pass one of the following values for the SelectMethod attribute:
  • WAIT—The record is locked for SELECT FOR UPDATE operation.
  • NO_WAIT—The record is locked for SELECT FOR UPDATE NOWAIT operation.
  • NONE—Locking mechanism is not used.
Note: If you pass any other value for the SelectMethod attribute, an error is thrown indicating that the "SelectMethod" attribute value is not valid.
  • If the SelectMethod attribute does not exist or if it is set to NONE in the input XML, the locking mechanism is not used.
  • SelectMethod attribute is supported only for getAPI. Ensure that you verify the input xml of getAPI if the SelectMethod attribute is exposed.