+ public synchronized void start() throws ProCoreException {
+ try {
+ raLockFile = new RandomAccessFile(lockFile.toFile(), "rw");
+ lock = raLockFile.getChannel().tryLock();
+ if (lock == null) {
+ safeLoggingClose(raLockFile, lockFile);
+ throw new ProCoreException("The database in folder " + folder.toAbsolutePath() + " is already in use!");
+ }
+ isRunning = true;
+ } catch (IOException e) {
+ LOGGER.error("Failed to start database at " + folder.toAbsolutePath(), e);
+ safeLoggingClose(raLockFile, lockFile);
+ throw new ProCoreException("Failed to start database at " + folder.toAbsolutePath(), e);
+ }