[
https://issues.apache.org/jira/browse/FLINK-41208?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Martijn Visser updated FLINK-41208:
-----------------------------------
Release Note: JdbcSource with DeliveryGuarantee.EXACTLY_ONCE now rejects
ResultSet.CONCUR_READ_ONLY as the result set type when the source is built.
This value was accepted before but never produced a scrollable result set: most
drivers fail on it when the query runs, and MySQL treats it as forward-only, so
the job cannot restore from a checkpoint. Use
setResultSetType(ResultSet.TYPE_SCROLL_INSENSITIVE) instead.
> JdbcSourceBuilder accepts ResultSet.CONCUR_READ_ONLY as a result set type for
> exactly-once
> ------------------------------------------------------------------------------------------
>
> Key: FLINK-41208
> URL: https://issues.apache.org/jira/browse/FLINK-41208
> Project: Flink
> Issue Type: Bug
> Components: Connectors / JDBC
> Affects Versions: jdbc-3.3.0, jdbc-4.1.0
> Reporter: Purushottam Sinha
> Priority: Minor
> Labels: pull-request-available
>
> {{JdbcSourceBuilder.build()}} validates the result set type for
> {{DeliveryGuarantee.EXACTLY_ONCE}} as:
> {code:java}
> this.resultSetType == ResultSet.TYPE_SCROLL_INSENSITIVE
> || this.resultSetType == ResultSet.CONCUR_READ_ONLY
> {code}
> {{CONCUR_READ_ONLY}} (1007) is a result set concurrency constant, not a
> result set type. So {{setResultSetType(ResultSet.CONCUR_READ_ONLY)}} passes
> the check, and the value is then handed to {{Connection.prepareStatement(sql,
> resultSetType, resultSetConcurrency)}} in {{JdbcSourceSplitReader}}, where it
> is not a valid type.
> *Fix:* only accept {{ResultSet.TYPE_SCROLL_INSENSITIVE}} for exactly-once and
> update the error message accordingly.
> Found while reviewing the docs PR
> https://github.com/apache/flink-connector-jdbc/pull/220.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)