Find and remove abandoned locks and perform lock time-out operations

Describes how to find and remove abandoned record locks and perform lock-timeout operations

In the pessimistic locking model, situations can occur where record locks are abandoned and need to be manually removed. For example, abandoned locks can be the result of a system crash or users forgetting to complete an update.

One aspect of an overall lock management strategy is to periodically scan to find locked records. You can do this by creating a query that finds locked records and identifies the user that holds each lock. Create a query on the appropriate record type that filters on the locked_by field to select records that have a non-empty value. In general, it is useful to include the locked_by field in your query displays so that the result sets show the name of the users who hold record locks. As an administrator, this practice is important if you need to respond to a user who asks to have a lock removed. The user might not have permission to remove the lock, and might not know who holds the lock, so they cannot ask the person who holds the lock if they are done with the record. After using a query to determine who owns the locked record and checking with the user that holds the lock, you can manually remove the lock on behalf of the user, if appropriate. Manual lock removal depends on the schema developer providing an unlock action on the record type.

Perform lock-timeout operations

The pessimistic locking model in HCL Compass supports only a manual lock-timeout mechanism. You can use the Perl script from the command line to find locked records, monitor locked records at a specified time interval, and perform lock-timeout operations such as removing abandoned locks. You can also write your own script to perform lock-timeout operations by using the script as an example.