[ https://issues.apache.org/jira/browse/IGNITE-21854?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17833602#comment-17833602 ]
Pavel Pereslegin edited comment on IGNITE-21854 at 4/3/24 2:24 PM: ------------------------------------------------------------------- It might also be worth getting rid of {{AutoCloseable}} in {{org.apache.ignite.sql.Statement}}; at the moment this method is not implemented and can be confusing. For example: {code:java} try (Statement stmt = ignite.sql().createStatement("SELECT 1")) { } {code} produces UnsupportedOperationException was (Author: xtern): It might also be worth getting rid of {{AutoCloseable}} in {{org.apache.ignite.sql.Statement}}; at the moment this method is not implemented and can be confusing. For example: {code:java} try (Statement stmt = ignite.sql().createStatement("SELECT 1")) { } {code} produces UnsupportedOperationException > Sql. Revise public API > ----------------------- > > Key: IGNITE-21854 > URL: https://issues.apache.org/jira/browse/IGNITE-21854 > Project: Ignite > Issue Type: Improvement > Components: sql > Reporter: Konstantin Orlov > Priority: Major > Labels: ignite-3 > > At the moment, IgniteSql provides universal method {{execute}} to execute any > type of queries. The problem is execute returns {{ResultSet}} which, in turn, > extends {{AutoCloseable}} interface. This causes a lot of warnings of static > code analyzers and forces users to wrap every invocation in > try-with-resources, which is not very convenient given that not every query > actually contains result set and thus should be closed (an example of queries > which doesn't contain result set are every DML or DDL query). -- This message was sent by Atlassian Jira (v8.20.10#820010)