if (closeChannel && rafile.getChannel().isOpen()) {
rafile.close();
rafile=null;
+ } else {
+ // just release the lock without doing anything to the channe;l
+ if (lock!=null && lock.isValid())
+ lock.release();
}
- if (lock!=null && lock.isValid())
- lock.release();
-
}
} catch (IOException e) {
log.warn("Whilst releasing lock",e);