Persitence strategy "never"

Hi all,

I have tons of items and I don´t want to mention every single one in the Items section of jdbc.persist, so I did this

.....
Items {
    // persist all items once a day and on every change and restore them from the db at startup
	* : strategy = everyChange, everyDay, restoreOnStartup
}

Now I have an item, though, that should not be persistet.
As there is no strategy “never”, I tried this for it but it doesnt work :frowning:

Strategies {
	// if no strategy is specified for an item entry below, the default list will be used
	everyHour   : "0 0 * * * ?"
   	everyDay    : "0 0 0 * * ?"
    every5Minutes : "0 0/5 * 1/1 * ? *"
	never : "0 0 0 ? * * 2099"
	
   	default = everyChange
}
Items {
    // persist all items once a day and on every change and restore them from the db at startup
	* : strategy = everyChange, everyDay, restoreOnStartup

	chartItem : strategy = never
	
}

Any hints ?

Thanks all!

„never“ wouldn‘t help you, strategies are not merged but processed one by one.

You need to specify all those items you want to be persisted but you can use groups to do that, see persistence docs.

If you are in the “need” to persist “tons -1” items, there is no easy way to configure such ( at least as far as I know).
I’d rather question your real need to persist that much items. I’d either persist them all ( including this single one) or make a real decision what to persist and put all those items in a group ( like @mstormi suggested).

2 Likes

I come across one of these issues:

There is no way to exclude item unless you patch OH persistence core (which I did for my own reasons), only then you can exclude items from being pulled in. I did some adjustments there to exclude items based on name pattern or tags (ie. volatile, computed). Best define an issue in OH core so it will eventually come into somebody’s attention.

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.