[JDBC] Player items are not persisted #5347
Comments
Please provide a debug log and your configuration settings. |
This is the log while JDBC is in DEBUG:
Or are you asking for OH to be run with the debug script? Here are the configurations: |
Yes, that's what I was after. My guess is the problem occurs when the item is first created, though, which isn't captured here. |
If you list your items in the console, does this item show up? The code I'm looking at would appear to indicate the item is not being found in the registry:
|
Here is a log with JDBC and rootLogger both in DEBUG while creating Virtual_Player_2 in PaperUI. I'll need to research more on what the debug script is turning on for logging if this is not enough detail.
|
When changing the state of this new dummy item (Virtual_Player_2) from the console, I see
But nothing from JDBC. I would expect storeItemValue to log "JDBC::store: Unable to store item '{}'." The state is changing properly, as displayed from the console. |
There doesn't appear to be any debug output coming from JDBC in those logs. This appears to be the package that should be set to DEBUG: org.openhab.persistence.jdbc |
I was surprised by this as well! I tested some other items and JDBC logged them. openhab> log:get |
It appears the PersistenceServiceDelegate silently drops items whose type it doesn't recognize:
The mapToOpenHABItem method doesn't grok Player. We may need @kaikreuzer to weigh in on whether the compat1x layer should support unknown types. |
The compat layer deals with the types that exist in openHAB 1 (and Player is not one of them) as it delegates to services that were implemented for openHAB 1 only and that therefore would not know a Player type. |
@openhab-5iver would you like to open a feature request on OH2 for porting the persistence? I'll do it if not... |
@9037568, hopefully I have provided enough detail. And thank you very much for tracking down the root of the issue! |
Current Behavior
Items of type PLAYER are not persisted and the following error occurs on startup:
This behavior has been confirmed by others in the forum. The same occurs with a dummy PLAYER item, so this is not related to the Kodi 2.x binding.
Possible Solution
I expect JDBC SQL Persistence bundle has not been updated since PLAYER items were introduced. Although, it could be the MariaDB JDBC Client, as it has only been confirmed with MariaDB databases.
Steps to Reproduce (for bugs)
Context
I used persistence to pause and unpause Kodi during an audio alert. Once I upgraded to the Kodi 2.x binding, with a PLAYER item, I can no longer get the persisted data. I have modified my affected rules by simply setting a variable to hold the state of the Kodi player.
Your Environment
OH 2.2.0 snapshot build 1072 (and previous versions)
Fedora 25
MariaDB JDBC Client 1.3.5.0
openHAB JDBC SQL Persistence bundle 1.11.0.201710292249
mariadb-config-10.1.25-1.fc25.x86_64
mariadb-common-10.1.25-1.fc25.x86_64
mariadb-server-10.1.25-1.fc25.x86_64
mariadb-errmsg-10.1.25-1.fc25.x86_64
mariadb-libs-10.1.25-1.fc25.x86_64
mariadb-server-utils-10.1.25-1.fc25.x86_64
mariadb-java-client-1.4.6-1.fc25.noarch
mariadb-10.1.25-1.fc25.x86_64
The text was updated successfully, but these errors were encountered: