× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Well, I have written a little CL program that is very short that will lock a 
file for exclusive
use.  This program is run when my operatiors want to run a certain process that 
takes a
while to run and everyone needs to be out of certain files on our system.

It basically attempts to lock the file exclusively with no wait, and has a 
MONMSG for any
error.  If an error occurs, it brings up the WRKOBJLCK display for the object.  
This command
will show who has the file locked.  Then my users can call them and request 
they get out of the
file.  After all the users are out (they refresh the display til all users are 
gone) they press enter of
F3 or whatever they want to end the display, the CL will once again attempt to 
lock the file
exclusively.  If it fails again it sends a program message saying it could not 
lock the file, otherwise
it sends a message that the file was locked.

I don't see why you can't do the same thing but automate it.  WRKOBJLCK has an 
option of
*PRINT.  You could either use that, then open up the print file (CPYSPLF) and 
end the jobs
of the people who have the file open (your users will hate you) or find some 
API that does the
same request.

I would not suggest, however, automatically ending the jobs of users who have a 
file open.  Perhaps
its the president of the company who is looking at sales data for the quarter, 
and all of a sudden his
display locks up and he winds up at a sign in screen (or the equivalent if you 
are on client/server).
I think you'd be getting some nasty phone calls *real* quick.

Regards,

Jim Langston

a b wrote:

> Is there a way to automate the removal of all object
> locks from a file?
>
> For example, if I have an application that needs to
> run... prior to it's execution... I'd like to check
> for object locks and remove them.
>
> Any help would greatly be appreciated.
>
> Thanks

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

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

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

This mailing list archive is Copyright 1997-2024 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].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.