KEEP LONGTERM is a navigational DML command that sets or releases longterm record locks. Longterm locks are shared or exclusive locks that are maintained across run units. Once the longterm locks are set, all other run units are restricted from updating or accessing the named records until the dialog explicitly releases the locks.
Example
The following example requests the release of all longterm locks associated with the current task:
KEEP LONGTERM ALL RELEASE
The KEEP LONGTERM command can also be used to monitor the database activity associated with a record, set, or area. When a dialog is updating records that could also be updated by another user, the following code can be included in the premap process of the named dialog:
KEEP LONGTERM longterm-id NOTIFY CURRENT record-name
This command instructs the CA ADS runtime system to monitor the database activity associated with the current occurrence of the named record type.
The following code is included in the response process of the same dialog:
KEEP LONGTERM longterm-id TEST RETURN NOTIFICATION INTO return-location-v
This command requests notification of any database activity against records that were specified in the KEEP LONGTERM premap process. If appropriate, the dialog can check the return value placed in the specified work record field.
|
Copyright © 2013 CA.
All rights reserved.
|
|