Feedback
Did this article resolve your question/issue?

   

Article

Does the CAN-FIND function lock records if NO-LOCK is not specified?

« Go Back

Information

 
TitleDoes the CAN-FIND function lock records if NO-LOCK is not specified?
URL Name000043272
Article Number000171211
EnvironmentProduct: OpenEdge
Version: All supported versions
OS: All supported platforms
Other: N/A
Question/Problem Description
Does the CAN-FIND function lock records if NO-LOCK is not specified?
 
What does the CAN-FIND function do and how does it do it?
 
How does the CAN-FIND function work as far as locking is concerned?
Steps to Reproduce
Clarifying Information
Error Message
Defect/Enhancement Number
Cause
Resolution
1. The CAN-FIND function does not lock records or return data to the record buffer.
 
2. The default locking mode for the CAN-FIND function is NO-LOCK.  That is, if no locking mode is specified with the CAN-FIND function, the NO-LOCK option is assumed.
 
3. The CAN-FIND function simply reports whether a specific record exists and whether it can be fetched in the locking mode specified in the CAN-FIND option.  That is, if the record exists and can be retrieved using the specified lock mode,  the CAN-FIND function returns TRUE otherwise it returns FALSE.
 
4. The CAN-FIND + NO-LOCK returns TRUE if the record exists regardless whether that record is locked by another user using SHARE-LOCK or EXCLUSIVE-LOCK or not.

5. The CAN-FIND + SHARE-LOCK returns TRUE if the record exists and is not held with an EXCLUSIVE-LOCK by another user.  In other words,  it returns TRUE if the records exists and is held NO-LOCK by another user and it also returns TRUE if the record exists and is held SHARE-LOCK by another user.
 
6.  The CAN-FIND + SHARE-LOCK function waits if the record exists and is held EXCLUSIVE-LOCK by another user and the message “[file-name] in use by [user] on [tty]. Wait or choose CANCEL to stop. (2624)” is displayed to give the user the choice of waiting till the records is released or canceling.  In this case, if the users cancels, the CAN-FIND function returns FALSE.

7.  The CAN-FIND + SHARE-LOCK + NO-WAIT function returns FALSE immediately if the record does not exist or is held EXCLUSIVE-LOCK by another user.
Workaround
Notes
Last Modified Date9/20/2013 9:11 PM
Attachment 
Files
Disclaimer The origins of the information on this site may be internal or external to Progress Software Corporation (“Progress”). Progress Software Corporation makes all reasonable efforts to verify this information. However, the information provided is for your information only. Progress Software Corporation makes no explicit or implied claims to the validity of this information.

Any sample code provided on this site is not supported under any Progress support program or service. The sample code is provided on an "AS IS" basis. Progress makes no warranties, express or implied, and disclaims all implied warranties including, without limitation, the implied warranties of merchantability or of fitness for a particular purpose. The entire risk arising out of the use or performance of the sample code is borne by the user. In no event shall Progress, its employees, or anyone else involved in the creation, production, or delivery of the code be liable for any damages whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or other pecuniary loss) arising out of the use of or inability to use the sample code, even if Progress has been advised of the possibility of such damages.