The function unrollAndRetry will be called after a fixed number of retries. The purpose is to insert the correct records in the same batch of records into the database, and the wrong records will be discarded.
During the iteration, because of an exception, the sql connection is closed and the database name is lost, resulting in an error when inserting into the database regardless of whether the record is correct or not.
Fix this problem by re-obtaining the database name before getting the connection.
To fix https://github.com/taosdata/kafka-connect-tdengine/issues/19#issue-1312679718
The function unrollAndRetry will be called after a fixed number of retries. The purpose is to insert the correct records in the same batch of records into the database, and the wrong records will be discarded.
During the iteration, because of an exception, the sql connection is closed and the database name is lost, resulting in an error when inserting into the database regardless of whether the record is correct or not.
Fix this problem by re-obtaining the database name before getting the connection.