Jdbc persisting unreliable / Errors

I have some Problems with my jdbc persistence.
I’m using openhab 2.3 on Debian 9 with MariaDB 10

  • Some Items don’t get persited
  • Some Items get persited but not restored on startup

If I update the jdbc.persist file, I get this error in the Logs

21:43:57.388 [INFO ] [del.core.internal.ModelRepositoryImpl] - Refreshing model 'jdbc.persist'
21:43:57.466 [ERROR] [l.core.internal.folder.FolderObserver] - Error handling update of file '/etc/openhab2/persistence/jdbc.persist': No enum constant org.openhab.core.library.types.OnOffType.0.0.
java.lang.IllegalArgumentException: No enum constant org.openhab.core.library.types.OnOffType.0.0
    at java.lang.Enum.valueOf(Enum.java:238) ~[?:?]
    at org.openhab.core.library.types.OnOffType.valueOf(OnOffType.java:1) ~[?:?]
    at org.openhab.persistence.jdbc.db.JdbcBaseDAO.getState(JdbcBaseDAO.java:489) ~[?:?]
    at org.openhab.persistence.jdbc.db.JdbcBaseDAO.doGetHistItemFilterQuery(JdbcBaseDAO.java:343) ~[?:?]
    at org.openhab.persistence.jdbc.internal.JdbcMapper.getHistItemFilterQuery(JdbcMapper.java:154) ~[?:?]
    at org.openhab.persistence.jdbc.internal.JdbcPersistenceService.query(JdbcPersistenceService.java:201) ~[?:?]
    at org.openhab.core.persistence.internal.QueryablePersistenceServiceDelegate.query(QueryablePersistenceServiceDelegate.java:47) ~[?:?]
    at org.eclipse.smarthome.core.persistence.internal.PersistenceManagerImpl.initialize(PersistenceManagerImpl.java:262) ~[?:?]
    at org.eclipse.smarthome.core.persistence.internal.PersistenceManagerImpl.startEventHandling(PersistenceManagerImpl.java:377) ~[?:?]
    at org.eclipse.smarthome.core.persistence.internal.PersistenceManagerImpl.addConfig(PersistenceManagerImpl.java:352) ~[?:?]
    at org.eclipse.smarthome.model.persistence.internal.PersistenceModelManager.addModel(PersistenceModelManager.java:110) ~[?:?]
    at org.eclipse.smarthome.model.persistence.internal.PersistenceModelManager.modelChanged(PersistenceModelManager.java:101) ~[?:?]
    at org.eclipse.smarthome.model.core.internal.ModelRepositoryImpl.notifyListeners(ModelRepositoryImpl.java:301) ~[?:?]
    at org.eclipse.smarthome.model.core.internal.ModelRepositoryImpl.addOrRefreshModel(ModelRepositoryImpl.java:139) ~[?:?]
    at org.eclipse.smarthome.model.core.internal.folder.FolderObserver.checkFile(FolderObserver.java:227) ~[?:?]
    at org.eclipse.smarthome.model.core.internal.folder.FolderObserver.processWatchEvent(FolderObserver.java:291) ~[?:?]
    at org.eclipse.smarthome.core.service.WatchQueueReader.lambda$3(WatchQueueReader.java:323) ~[?:?]
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:?]
    at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:?]
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) [?:?]
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) [?:?]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:?]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:?]
    at java.lang.Thread.run(Thread.java:748) [?:?]

I couldn’t find any other errors in the Logs.
My persist file is this

Strategies {
	// everyMinute	: "0 * * * * ?"
	// every5Minutes : "0 */5 * * * ?"
	everyHour   : "0 0 * * * ?"
	everyDay    : "0 0 0 * * ?"
	everyMonth	: "0 0 0 1 * ?"
	default = restoreOnStartup
}

Items {
	// Home* : strategy = restoreOnStartup
	gWeather*	: strategy = everyHour, restoreOnStartup
	gAllDoorsWindows* : strategy = everyChange, everyDay, restoreOnStartup
	gAlarmanlage*	: strategy = everyChange, everyDay, restoreOnStartup
	gSmoke : strategy = everyChange, everyDay, restoreOnStartup
	gSmoke* : strategy = everyChange, everyDay, restoreOnStartup
	gLights* : strategy = everyChange, everyDay, restoreOnStartup
	gChristmasLights* : strategy = everyChange, restoreOnStartup
	gUnifiVideo*	: strategy = everyChange, restoreOnStartup
	gBatterys*	: strategy = everyChange, restoreOnStartup
	gSignal*	: strategy = everyChange, restoreOnStartup
	netzwerk*	: strategy = everyHour, restoreOnStartup
	
	iProxyAmbientLight : strategy = everyChange, restoreOnStartup
	iProxyChristmasSeason : strategy = everyChange, everyMonth, restoreOnStartup
	iDayLight : strategy = everyChange, restoreOnStartup
	iNight : strategy = everyChange, restoreOnStartup
	iHelligkeitGarten : strategy = everyHour, restoreOnStartup
	
	FliesenbildMode : strategy = everyChange, restoreOnStartup
	iLichtWintergartenAutoLevel : strategy = everyChange, restoreOnStartup
	iLichtWintergartenAutoColor : strategy = everyChange, restoreOnStartup
}

For example “iLichtWintergartenAutoLevel” is a simple switch item, and gets persited in the db, but never restored on startup.
“iHelligkeitGarten” is a number, and gets only persited if I use everyChange, but not on cron times.

Some days with testing later. Persistence seems to fail every time a switch item has a undefinied state. It ignore then every rule that becomes after.