Hi all.

I was wondering if anybody has seen this problem. 
When trying to lock a file in java 1.4 on the As400,
an IOException : ?Object is to large to process. Lock
Failed.? is thrown.  The things is the file is only 10
characters long.  Is there a good work around for this
without changing the code?  Has anybody ever seen this
exception in the case of a small file?

Here is the code:
FileChannel channel = null;
RandomAccessFile raf = null;
raf = new RandomAccessFile(file,"rw");
channel = raf.getChannel();

// Try acquiring the lock without blocking. This
method returns
// null or throws an exception if the file is already
if(channel.tryLock() == null){
retval = false;
logger.error("File in use by another object or
process: "+file.getAbsolutePath());     

}catch(Exception e){
retval = false;
logger.error("File in use by another object or
process: "+file.getAbsolutePath());



Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!

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.