snuyanzin commented on PR #9:
URL: 
https://github.com/apache/flink-connector-jdbc/pull/9#issuecomment-1562313350

   thanks for pointing to javadoc,
   I've checked the javadoc for `java.sql.Statement#close` method as well e.g. 
[1]
   and there is such statement
    >Calling the method close on a Statement object that is already closed has 
no effect. 
   
   At the same time if we have a look at amazon redshift jdbc (based on trace 
from jira issue)
   ```
   Caused by: com.amazon.redshift.util.RedshiftException: This connection has 
been closed.
       at 
com.amazon.redshift.jdbc.RedshiftConnectionImpl.checkClosed(RedshiftConnectionImpl.java:1095)
 ~[?:?]
       at 
com.amazon.redshift.jdbc.RedshiftConnectionImpl.cancelQuery(RedshiftConnectionImpl.java:1299)
 ~[?:?]
       at 
com.amazon.redshift.jdbc.RedshiftStatementImpl.cancel(RedshiftStatementImpl.java:1042)
 ~[?:?]
       at 
com.amazon.redshift.jdbc.RedshiftStatementImpl.close(RedshiftStatementImpl.java:748)
 ~[?:?]
   ```
   
   it leads to `RedshiftConnectionImpl#checkClosed` [2]
   ```java
     protected void checkClosed() throws SQLException {
       if (isClosed()) {
         throw new RedshiftException(GT.tr("This statement has been closed."),
             RedshiftState.OBJECT_NOT_IN_STATE);
       }
     }
   ```
   
   it violates the contracts mentioned in javadoc....
   I would incline to consider that this is a redshift jdbc driver bug
   [1] https://docs.oracle.com/javase/8/docs/api/java/sql/Statement.html#close--
   [2] 
https://github.com/aws/amazon-redshift-jdbc-driver/blob/master/src/main/java/com/amazon/redshift/jdbc/RedshiftStatementImpl.java#L828-L833


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to