[ 
https://issues.apache.org/jira/browse/FLINK-41208?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Martijn Visser updated FLINK-41208:
-----------------------------------
    Fix Version/s: jdbc-5.0.0

> 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
>            Assignee: Purushottam Sinha
>            Priority: Minor
>              Labels: pull-request-available
>             Fix For: jdbc-5.0.0
>
>
> {{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)

Reply via email to