Previous Topic: Extended Run UnitsNext Topic: Global Records


Longterm Locks

The KEEP LONGTERM command sets or releases longterm record locks. Longterm locks are shared or exclusive locks that are maintained across transactions. Once the longterm locks are set, all other transactions are restricted from updating or accessing the named records until the dialog explicitly releases the locks. The following example requests the release of all longterm locks associated with the current task:

KEEP LONGTERM ALL RELEASE

Monitoring Database Activity

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.

For more information on the KEEP LONGTERM command, refer to the CA ADS Reference Guide.