Persistence - I don’t get it:
My Groups:
Group G_Numbers "Numbers for Diagramms"
Group G_jdbc "jdbc SQL"
It’s about these representative items
String ActTime "Zeit: [%s]" (G_jdbc)
Number Presence_Num "Anwesenheit Num [%s]" (G_Numbers)
Switch Trigger_Debug "Debug Trigger" (G_jdbc)
I am using the following jdbc.persist file (on mariaDB):
Strategies {
every5Minutes : "0 0/5 * * * ?"
default = everyChange, restoreOnStartup
}
Items {
G_jdbc* : strategy = everyChange, restoreOnStartup
G_Numbers* : strategy = everyChange, restoreOnStartup, every5Minutes
}
Loading this persist creates an error:
2018-08-17 17:25:36.663 [ERROR] [.core.internal.folder.FolderObserver] - Error handling update of file '/etc/openhab2/persistence/jdbc.persist': null.
java.lang.NullPointerException: null
and leads to:
ActTime is a string and stored on everyChange = every minute (cron writes in a rule the actual time into this string) - this can be found correctly in the DB - right!
Presence_Num is a Number and should be stored every 5 Minutes into the DB (for Charts) - but it’s not - wrong
Trigger_Debug is a Switch set by cron every 30 min to verify persistence issues - it’s not stored in the DB - wrong
This jdbc.persist config is loaded without issues:
Refreshing model 'jdbc.persist'
Strategies {
every5Minutes : "0 0/5 * * * ?"
default = everyChange, restoreOnStartup
}
Items {
G_jdbc* : strategy =
G_Numbers* : strategy = every5Minutes
}
but leads to:
ActTime: This time it is stored every 5 minutes only - (the rule still changes this string every minute) - wrong
Presence_Num: Now it’s stored every 5 Minutes in the DB - right
Trigger_Debug is not written into the DB - wrong
This config also loads with an error:
Error handling update of file '/etc/openhab2/persistence/jdbc.persist': null.
java.lang.NullPointerException: null
Strategies {
every5Minutes : "0 0/5 * * * ?"
default = everyChange, restoreOnStartup
}
Items {
* : strategy = every5Minutes, everyChange, restoreOnStartup
}
and leads to:
ActTime: stored every minute - right
Presence_Num: Not stored - should be stored every 5 minutes according to the persist settings - wrong
Trigger_Debug: Not stored - should be stored every 5 minutes according to the persist settings - wrong
The only thing I want is to store numbers every 5 minutes and the other items (mostly strings and Switches) on changes only and restore on startup…
In my previous installations (1.8 / 2.0 / 2.1 / 2.2) I don’t remember such an inconsistent behaviour.
Any hint into the right direction is greatly appreciated.