Record locks are used to protect the integrity of database records.
Share and Exclusive Locks
Record locks protect object records from concurrent access or update by other run units. Locks can be shared or exclusive:
Implicit and Explicit Record Locks
Record locks can be set implicitly by the DC/UCF central version and explicitly by the application developer, as follows:
Long-term explicit record locks are shared or exclusive record locks that are maintained across run units. A long-term lock placed on a record restricts other concurrently executing run units from accessing or updating the record until the lock is explicitly released. Subsequent run units in the same CA ADS application that execute from the same terminal can access and update the locked record, and can upgrade or release the long-term lock.
Note: For more information about record locks, see the CA IDMS Database Design Guide.
The following conditions resulting from the use of record locks can cause abnormal termination of an CA ADS application:
An online application can include logic that is invoked if the run unit is terminated because of a db-key deadlock. In this way, the application can maintain the terminal session and save data previously entered on the screen. The application can then ask the user to resubmit the transaction or automatically restart the run unit, establish currency, and try again.
If the run unit is automatically restarted, the following steps should be followed:
Note: For more information about handling the minor code 29, see the CA IDMS Navigational DML Programming Guide.
Checking for Deadlock Conditions
Deadlock conditions can be checked for programmatically by using the ALLOWING clause when autostatus is enabled. The check for a deadlock condition can be made after each service request to the DBMS.
Note: For more information about record contention, see the CA IDMS Database Design Guide.
|
Copyright © 2014 CA.
All rights reserved.
|
|