How to set an EXCLUSIVE LOCK with JDBC

Document ID : KB000117463
Last Modified Date : 15/10/2018
Show Technical Document Details
Introduction:
This document provides an example of how to use a PROCEDURE to place an exclusive lock on a record occurrence.
Background:
There is no way to place the equivalent of an EXCLUSIVE LOCK on a record occurrence using SQL syntax.
There is a FOR UPDATE clause but it is designed to impact the optimization of the query and doesn't place any additional locks.
Environment:
CA IDMS, all supported releases.
Instructions:
The attached .zip file contains sample source code for a procedure to place an EXCLUSIVE LOCK on a network-defined record.
The file contains the procedure definition, the source code of the implementing cobol program, and sample Java code to invoke it.
Additional Information:
Defining and Using Procedures
Locking Records
File Attachments:
sampokxl.zip