Data not restored at startup from MapDB

Hi all,

I would like to use a combination of the MySQL persistence in combination with MapDB.
Up until this moment I was only using MySQL and it is configured as the default persistence service.
This persistence service is running fine. Item states are stored and restored fine.

The issue:
I’ve installed the MapDB persistence service in order to establish some restores at startup of items that don’t need to be persisted for every change or update. Only the last value is important.
I’ve created one item as a test:
Switch HeatingOffClearDay "Test" (RestoreUpdate)

I’ve also created the group RestoreUpdate.
My MapDB persistence file looks like this:
Strategies { default = everyChange } Items { RestoreUpdate* : strategy = everyUpdate, restoreOnStartup RestoreChange* : strategy = everyChange, restoreOnStartup }

I’ve tried to update this Switch item via the rest api interface and I see the folowing in the log file:
2017-04-04 13:23:45.396 [DEBUG] [pdb.internal.MapDBPersistenceService] - store called for HeatingOffClearDay 2017-04-04 13:23:45.399 [DEBUG] [pdb.internal.MapDBPersistenceService] - Stored 'HeatingOffClearDay' with state 'ON' in mapdb database

So up until this point everything looks normal but when I restart OpenHAB, the state remaims NULL (checked via rest api interface). Also nothing is logged about restoring of items from the MapDB persistence. I only see a message that the MapDB service has been started.

Does anyone has any idea what is going wrong or what I’m missing? I’m using build #843.

Thanks!

Anybody any idea?

Thanks

Did you find any info on the topic?

I can’t figure out how to check if restoreOnStartup is working with persistence mapdb…

I think that it’s working on my system (I don’t have NULLs) but 1 item is getting restored with the wrong value and I am trying to debug the persistence to see if something is going on there (or the mistake is coming from my rules)

Does anyone know what logger I should be monitoring for restoreOnStartup messages?

With log:set DEBUG org.openhab.persistence.mapdb I see only storing messages (and this works fine):

2017-06-18 21:27:17.050 [DEBUG] [pdb.internal.MapDBPersistenceService] - store called for mP3_04_01_U
2017-06-18 21:27:17.054 [DEBUG] [pdb.internal.MapDBPersistenceService] - Stored 'mP3_04_01_U' with state '2017-06-18T21:27:17' in mapdb database
2017-06-18 21:27:17.054 [DEBUG] [pdb.internal.MapDBPersistenceService] - store called for mP3_04_02_V
2017-06-18 21:27:17.055 [DEBUG] [pdb.internal.MapDBPersistenceService] - Stored 'mP3_04_02_V' with state '215' in mapdb database
2017-06-18 21:27:17.056 [DEBUG] [pdb.internal.MapDBPersistenceService] - store called for mP3_04_02_P
2017-06-18 21:27:17.056 [DEBUG] [pdb.internal.MapDBPersistenceService] - Stored 'mP3_04_02_P' with state '82.0' in mapdb database

Hi @Dim,

No I never had a solution for this problem on the nightly built I was using BUT…
I think that in my case, that there was a bug in the MapDB for that release since I upgraded to another nightly built a few weeks after and the problem didn’t exist anymore on that built.
Sorry that I can’t give you any more information on this. Maybe somebody else can give you some more advise.

Greetings,
Frederic

1 Like