From: Jussi Koskela Date: Tue, 9 May 2017 13:12:17 +0000 (+0300) Subject: Improved logic in new head state creation. X-Git-Tag: v1.29.0~67 X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=commitdiff_plain;h=25c9cc192b2611646b0a476bf205484500e92997;hp=25c9cc192b2611646b0a476bf205484500e92997 Improved logic in new head state creation. Earlier any IOException during the reading of head state was interpreted as empty DB. This might cause unwanted DB reset. It's better to identify need for empty head state based on main state head directory. Switched AcornDatabase.start logic back to using RandomAccessFile for touching the db/lock file. Using RandomAccessFile instead of FileSystemProvider.newFileChannel in Windows better prevents any other process from removing the lock file. The newFileChannel version did not prevent the user from initially running 'del lock' to remove the file - although the file will be recreated quickly by the system. Also AcornDatabase.start now re-throws ProCoreException if opening/locking the lock-file fails with IOException to prevent the system from attempting to start up without a proper database to work with. Previously the system just logged the start-up problem and continued. refs #7124 Change-Id: I850b47d8f692e3d1b8ce177b9269540edc4dc272 ---