• Subject: RE: Why is this lock going through when I am updating the file?
  • From: "Sims, Ken" <KSIMS@xxxxxxxxxxxxxxxx>
  • Date: Tue, 2 Jan 2001 18:14:50 -0500

Hi Jim -

>I have a CL trigger program on a file on an *INSERT *AFTER 
>basis.  In this trigger I am attempted to find out when 
>this file is done being written. I retrieve the &LIBRARY, 
>&FILE and &MEMBER names from the Trigger Parameter 1, then 
>attempt to lock the file thusly:
 ...
>Any ideas why the program isn't waiting for the file to be 
>locked?  Or why is it allowing an exclusive lock on an open 
>file?

So long as only the job having a lock is the job requesting the lock, the
lock will be granted.  A job cannot lock itself out of any object.  If it
could, you would have an endless loop.  Since the original program does not
regain control until the trigger program is done, how would the program
inserting the record ever close the file if the trigger program is waiting
for the file to be closed?

Ken
Southern Wine and Spirits of Nevada, Inc.
Opinions expressed are my own and do not necessarily represent the views of
my employer or anyone in their right mind.

+---
| This is the Midrange System Mailing List!
| To submit a new message, send your mail to MIDRANGE-L@midrange.com.
| To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com.
| To unsubscribe from this list send email to MIDRANGE-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2020 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].