Hi folks,
Since I started I have used mysql persistence. It works and works well. I want to use mapdb now for restoreOnStartup to see if I can make restarting of OH a bit quicker as some of my items have a lot of history and also runs on an RPi
I have mapdb installed. It does not persist anything unless I call .persist(“mapdb”) in a rule.
I have logging set to debug and can only see it doing stuff when I call .persist(“mapdb”). It does not persist on change
mysql.persist
// persistence strategies have a name and a definition and are referred to in the "Items" section
Strategies {
// if no strategy is specified for an item entry below, the default list will be used
everyMinute : "0 * * * * ?"
every5Minutes : "0 */5 * * * ?"
everyHour : "0 0 * * * ?"
everyDay : "0 0 0 * * ?"
default = everyChange
}
/*
* Each line in this section defines for which item(s) which strategy(ies) should be applied.
* You can list single items, use "*" for all items or "groupitem*" for all members of a group
* item (excl. the group item itself).
*/
Items {
g_persist_change* : strategy = everyChange//, restoreOnStartup
g_persist_minute* : strategy = everyMinute//, restoreOnStartup
g_persist_5minute* : strategy = every5Minutes//, restoreOnStartup
g_persist_hour* : strategy = everyHour
g_persist_day* : strategy = everyDay
gScenePersist* : strategy = everyChange//, restoreOnStartup
}
mapdb.persist
// persistence strategies have a name and a definition and are referred to in the "Items" section
Strategies {
// if no strategy is specified for an item entry below, the default list will be used
// everyMinute : "0 * * * * ?"
// every5Minutes : "0 */5 * * * ?"
// everyHour : "0 0 * * * ?"
//everyDayMapDB : "0 0 0 * * ?"
default = everyChange
}
Items {
// persist all items once a day and on every change and restore them from the db at startup
g_persist_restore* : strategy = everyChange, restoreOnStartup
}
Items
Number JJKKUU "JJKKJJ" (g_persist_restore)
Number JJKKII "KKLL" (g_persist_restore)
adons.cfg
# A comma-separated list of persistence services to install (e.g. "rrd4j,jpa")
persistence = mysql,mapdb
LogFile
2019-08-06 11:32:57.246 [DEBUG] [org.openhab.persistence.mapdb ] - BundleEvent STARTING - org.openhab.persistence.mapdb
2019-08-06 11:32:57.255 [DEBUG] [b.internal.MapDBPersistenceActivator] - MapDB persistence bundle has been started.
2019-08-06 11:32:57.263 [DEBUG] [org.openhab.persistence.mapdb ] - ServiceEvent REGISTERED - {org.openhab.core.persistence.PersistenceService}={service.id=524, service.bundleid=273, service.scope=bundle, component.name=org.openhab.persistence.mapdb, component.id=353} - org.openhab.persistence.mapdb
2019-08-06 11:32:57.281 [DEBUG] [pdb.internal.MapDBPersistenceService] - mapdb persistence service is being activated
2019-08-06 11:32:57.776 [DEBUG] [pdb.internal.MapDBPersistenceService] - Scheduled Commit-Job with interval 5sec.
2019-08-06 11:32:57.779 [DEBUG] [pdb.internal.MapDBPersistenceService] - mapdb persistence service is now activated
2019-08-06 11:32:57.787 [DEBUG] [org.openhab.persistence.mapdb ] - BundleEvent STARTED - org.openhab.persistence.mapdb
The only thing I am not sure of is the default persistence setting in PaperUI. I have that set to mysql.
I am running this all on a RPi with SD card so do not want to write a lot to it so weary of setting that.
When I called .persist() without specifying the service it stored it in mysql. Why would that be considering there was no mysql attached to it.
Anything obvious as to why my items are not persisting with mapdb?
TIA
C