diff --git a/kahadb/src/main/java/org/apache/kahadb/util/LockFile.java b/kahadb/src/main/java/org/apache/kahadb/util/LockFile.java index 1d7b5b6ba3..d26b394fa3 100644 --- a/kahadb/src/main/java/org/apache/kahadb/util/LockFile.java +++ b/kahadb/src/main/java/org/apache/kahadb/util/LockFile.java @@ -55,7 +55,9 @@ public class LockFile { } IOHelper.mkdirs(file.getParentFile()); - readFile = new RandomAccessFile(file, "rw"); + if (readFile == null) { + readFile = new RandomAccessFile(file, "rw"); + } if (lock == null) { try { lock = readFile.getChannel().tryLock();