I’am using the MySql persistance to log when someone entered my house using an rfid chip. For all other values I’am using an InfluxDB. The problem now is that when no one entered the house for some time the sql connection seams to be disconnected. The binding does reconnect to the database, but the value is still not stored after that. So I’am loosing the log every time a reconnect is done. Here are the logs:
2018-05-31 10:24:46.641 [ERROR] [sql.internal.MysqlPersistenceService] - mySQL: Connection is not valid!
2018-05-31 10:24:46.649 [ERROR] [sql.internal.MysqlPersistenceService] - mySQL: Connection is not valid!
2018-05-31 10:24:46.651 [ERROR] [sql.internal.MysqlPersistenceService] - mySQL: Could not store item 'DoorLog' in database with statement 'INSERT INTO Item2 (TIME, VALUE) VALUES(NOW(),?) ON DUPLICATE KEY UPDATE VALUE=?;': No operations allowed after connection closed.
2018-05-31 10:25:15.580 [ERROR] [sql.internal.MysqlPersistenceService] - mySQL: Connection is not valid!
2018-05-31 10:25:15.583 [ERROR] [sql.internal.MysqlPersistenceService] - mySQL: Error count exceeded 6. Disconnecting database.
After the complete disconnection it works again when the next log needs to be saved, but only until the next longer period when nothing is logged. Does anyone knows how the binding could be improved to solve this problem?