Persistence strategy


i have a strategy like this

    default = everyChange 

    * : strategy = everyChange, restoreOnStartup

but i got this error

[.p.m.i.MysqlPersistenceService] - mySQL: Unable to find table for query 'grp_ ....'

how do i exclude all items starting with “grp_”?

OH 1.8.3

That would be treating the symptom, not the problem.

What you really need to do is figure out why the MySQL persistence engine failed to create a table for your grp_ Items. Did you by chance change the Item type of these Items? If so MySQL is unable to handle that and you will need to close openHAB, go into MySQL and delete the grp_ tables and let the persistence recreate it. If that doesn’t work you might need to delete them all and let persistence recreate everything.

Short of that, if you just want to treat the symptom, you cannot exclude Items in your persistence file, you can only include them. Perhaps the easiest way is to create a Group MySQLGroup, add all the Items you want to persist to that group and make your persistence strategy be:

MySQLGroup* : strategy = everyChange, restoreOnStartup
1 Like

i think the problem is, that i want to display data, where no data is because the grp_ (groups) are not updated, so no data has to be stored. or?

so i came up with that idea …

I might suggest switching to using one of the embedded databases to start with (rrd4j or db4o) until you get more comfortable with everything else you have to learn to get openHAB up and running.

Typically when there is no data retrieved in a query you will get a NullPointerException, not this error (though my experience with MySQL is none so maybe it works differently).

no data in an existing table is not an error instead of not finding the table.
so i think, if there is no data that is saved before, pm does not create a table …

as long as i think about the idea with the additional group to say which item is stored i think this idea is very good and i am going to use it.

may you have a look here?