Kbase P11482: How to prevent the error 2624 being displayed when a record is locked by another user
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  2/29/2008 |
|
Status: Verified
GOAL:
How to prevent the error 2624 being displayed when a record is locked by another user
GOAL:
How to prevent the display of message "<file-name> in use by <user> on <tty>. Wait or choose CANCEL to stop. (2624)"
GOAL:
How to avoid the 2624 error to be displayed
FACT(s) (Environment):
Progress 9.x
OpenEdge 10.x
All Supported Operating Systems
FIX:
Use NO-ERROR NO-WAIT options with the FIND statement.
When using FIND with EXCLUSIVE-LOCK NO-ERROR, if the record is already locked by another user then Progress display the error 2624 and will wait until the record is released.
The NO-ERROR option does not tell Progress not to display the error message when the record is locked, unless the NO-WAIT option is used on the FIND.
The NO-WAIT option causes FIND to return immediately and raise an error condition if the record is locked by another user, unless the NO-ERROR option is used on the same FIND statement.
Therefore the 2 options must be used together.
Example:
REPEAT TRANSACTION:
FIND FIRST customer EXCLUSIVE-LOCK NO-ERROR NO-WAIT.
IF AVAILABLE customer THEN
DO:
UPDATE name.
LEAVE.
END.
END.