Hi David,

A quick java search shows that you can use java to lock the file..http://www.studytrails.com/java-io/file-locking.jsp

So if all of this is done in java - would that be an option - If I was doing this - I would start here...


On 07/11/2014 13:48, Ron Byrd wrote:

Have you looked into the "Check Out" and "Check In" processes that are available from within the IBM I Navigator.
I do not know if this process is available from within Java or not.
I just know that it has caused me headaches in the past.
I just checked out a file in the navigator and then tried to change it with the same User Profile and it allows me to make changes
However if I try to change it with a different user it fails.

This may or may not work for you but is an option.



-----Original Message-----
From: JAVA400-L [mailto:java400-l-bounces@xxxxxxxxxxxx] On Behalf Of David Gibbs
Sent: Wednesday, November 05, 2014 12:59 PM
To: Java Programming on and around the IBM i
Subject: Re: Create an exclusive lock on an IFS file?

On 11/5/2014 8:54 AM, Kevin Passey wrote:
I've written some RCP based applications - and this is just off the
top of my head...would a lock file work...like OO does - create a
.~lock.filename-to-update in the same directory, if it does not exist
create it and go ahead and update - If the file does exist then it's
locked...when you've finished your updates remove the lock file so
that another workstation can get access to the file. The lock file
could also include the function name could it not?
This lock file needs to exist in the IFS, as it's specific to a system. And the mere existence of the file isn't sufficient because, if the application exits unexpectedly, the file might remain.

I needed to create a true lock on a file.

Another approach I was considering was to create a data area in QGPL and establish an exclusive lock on that, but I decided to go with the IFS file instead.


IBM i on Power Systems: For when you can't afford to be out of business!

I'm riding a metric century (100 km / 62 miles) in the 2015 American Diabetes Association's Tour de Cure to raise money for diabetes research, education, advocacy, and awareness. You can make a tax deductible donation to my ride by visiting http://email.diabetessucks.net. My goal is $5500 but any amount is appreciated.

See where I get my donations from ... visit http://email.diabetessucks.net/mapdonations.php for an interactive map (it's a geeky thing).
This is the Java Programming on and around the IBM i (JAVA400-L) mailing list To post a message email: JAVA400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/java400-l
or email: JAVA400-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/java400-l.

As an Amazon Associate we earn from qualifying purchases.

This thread ...


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

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