today i set up jdbc persistence services with mariadb. Everything works fine so far, i just got a problem with my icloud location items.
I get the following error message to my log:
21:07:26.327 [ERROR] [org.knowm.yank.Yank ] - Error in SQL query!!!
java.sql.SQLException: Data too long for column 'value' at row 1 Query: INSERT INTO applewatchig_location_0193 (TIME, VALUE) VALUES( NOW(3), ? ) ON DUPLICATE KEY UPDATE VALUE= ? Parameters: [53.11111111111111,8.999999999999999,0.0, [53.11111111111111,8.999999999999999,0.0]
at org.apache.commons.dbutils.AbstractQueryRunner.rethrow(AbstractQueryRunner.java:392) ~[bundleFile:?]
at org.apache.commons.dbutils.QueryRunner.update(QueryRunner.java:491) ~[bundleFile:?]
at org.apache.commons.dbutils.QueryRunner.update(QueryRunner.java:457) ~[bundleFile:?]
at org.knowm.yank.Yank.execute(Yank.java:194) [bundleFile:?]
at org.knowm.yank.Yank.execute(Yank.java:177) [bundleFile:?]
at org.openhab.persistence.jdbc.db.JdbcBaseDAO.doStoreItemValue(JdbcBaseDAO.java:329) [bundleFile:?]
at org.openhab.persistence.jdbc.internal.JdbcMapper.storeItemValue(JdbcMapper.java:156) [bundleFile:?]
at org.openhab.persistence.jdbc.internal.JdbcPersistenceService.store(JdbcPersistenceService.java:143) [bundleFile:?]
at org.openhab.core.persistence.internal.PersistenceManagerImpl.handleStateEvent(PersistenceManagerImpl.java:152) [bundleFile:?]
at org.openhab.core.persistence.internal.PersistenceManagerImpl.stateChanged(PersistenceManagerImpl.java:473) [bundleFile:?]
at org.openhab.core.items.GenericItem.lambda$1(GenericItem.java:259) [bundleFile:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
at java.lang.Thread.run(Thread.java:834) [?:?]
I already chaged in jdbc.cfg from:
sqltype.LOCATION = VARCHAR(30)
to
sqltype.LOCATION = VARCHAR(200)
because my unterstanding is that the field is too short. After i changed the value i deleted the table from mariadb and restarted openhab, but i still get the error and i dont know whats the reason.
thanks for your reply and help!
I didn’t quite understand what exactly you changed, though. Could you please give me some additional information on that?
I also deleted the jbdc.cfg and entered the data at the ui. I changed the SqlType from VARCHAR(200) to TEXT like at your screenshot.
I even checked the jdbc.config and everything seems to be fine.
I restarted openhab and cleared the cache.
It does not change existing tables, that you also remove the old table and the entry from the items table? If you do not do that you have to manually change existing tables.