nizhikov commented on code in PR #11528: URL: https://github.com/apache/ignite/pull/11528#discussion_r1795573143
########## modules/core/src/main/java/org/apache/ignite/internal/jdbc/thin/JdbcThinConnection.java: ########## @@ -2464,4 +2610,72 @@ boolean handleResult(long reqId, JdbcResult res) { return handled; } } + + /** Transaction context. */ + private class TxContext { + /** IO to transaction coordinator. */ + final JdbcThinTcpIo txIo; + + /** Transaction id. */ + final int txId; + + /** Closed flag. */ + boolean closed; + + /** Tracked statements to close results on transaction end. */ + private final Set<JdbcThinStatement> stmts = Collections.newSetFromMap(new IdentityHashMap<>()); + + /** */ + public TxContext(JdbcThinTcpIo txIo, int txId) { + assert !autoCommit; + + this.txIo = txIo; + this.txId = txId; + } + + /** */ + public void end(boolean commit) throws SQLException { + if (closed) + return; + + closed = true; + + for (JdbcThinStatement stmt : stmts) + stmt.closeResults(); Review Comment: Because, JDBC spec allows to keep statements over commit. -- 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: notifications-unsubscr...@ignite.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org