+ public synchronized void start() throws ProCoreException {
+ try {
+ lockFileChannel = lockFile.getFileSystem().provider().newFileChannel(lockFile,
+ EnumSet.of(StandardOpenOption.CREATE, StandardOpenOption.WRITE));
+
+ lock = lockFileChannel.tryLock();
+ if (lock == null) {
+ safeLoggingClose(lockFileChannel, 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(lockFileChannel, lockFile);
+ }