]> gerrit.simantics Code Review - simantics/platform.git/commitdiff
Improved logic in new head state creation. 97/497/2
authorJussi Koskela <jussi.koskela@semantum.fi>
Tue, 9 May 2017 13:12:17 +0000 (16:12 +0300)
committerTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Tue, 9 May 2017 14:37:04 +0000 (17:37 +0300)
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


No differences found