nizhikov commented on code in PR #11528: URL: https://github.com/apache/ignite/pull/11528#discussion_r1795534242
########## modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/jdbc/JdbcConnectionContext.java: ########## @@ -274,6 +284,41 @@ public JdbcConnectionContext(GridKernalContext ctx, GridNioSession ses, GridSpin super.onDisconnected(); } + /** {@inheritDoc} */ + @Override public ClientTxContext txContext(int txId) { + ensureSameTransaction(txId); + + return txCtx; + } + + /** {@inheritDoc} */ + @Override public void addTxContext(ClientTxContext txCtx) { + if (this.txCtx != null) + throw new IgniteSQLException("Too many transactions", IgniteQueryErrorCode.QUERY_CANCELED); + + this.txCtx = txCtx; + } + + /** {@inheritDoc} */ + @Override public void removeTxContext(int txId) { + ensureSameTransaction(txId); + + txCtx = null; + } + + /** */ + private void ensureSameTransaction(int txId) { + if (txCtx != null && txCtx.txId() != txId) { + throw new IllegalStateException("Unknown transaction " + + "[serverTxId=" + (txCtx == null ? null : txCtx.txId()) + ", txId=" + txId + ']'); + } + } + + /** {@inheritDoc} */ + @Override protected void cleanupTxs() { + txCtx = null; Review Comment: Good catch. Fixed. -- 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