David
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.
Thanks
Ron
-----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.
david
--
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.