This exception is thrown by the lock( ) and tryLock( ) methods of FileChannel if the requested lock region overlaps a file lock that is already held by some thread in this JVM, or if there is already a thread in this JVM waiting to lock an overlapping region of the same file. The FileChannel file locking mechanism is designed to lock files against concurrent access by two separate processes. Two threads within the same JVM should not attempt to acquire a lock on overlapping regions of the same file, and any attempt to do so causes an exception of this type to be thrown. Figure 13-34. java.nio.channels.OverlappingFileLockExceptionpublic class OverlappingFileLockException extends IllegalStateException { // Public Constructors public OverlappingFileLockException ( ); } |