Purushottam Sinha created FLINK-41208:
-----------------------------------------

             Summary: 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-4.1.0, jdbc-3.3.0
            Reporter: Purushottam Sinha


{{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