ascherbakoff commented on code in PR #3640:
URL: https://github.com/apache/ignite-3/pull/3640#discussion_r1576016843


##########
modules/client/src/main/java/org/apache/ignite/internal/client/sql/ClientSql.java:
##########
@@ -242,7 +243,17 @@ public <T> CompletableFuture<AsyncResultSet<T>> 
executeAsync(
         if (transaction != null) {
             try {
                 //noinspection resource
-                return 
ClientTransaction.get(transaction).channel().serviceAsync(ClientOp.SQL_EXEC, 
payloadWriter, payloadReader);
+                return ClientLazyTransaction.ensureStarted(transaction, ch, 
null)
+                        .thenCompose(tx -> 
tx.channel().serviceAsync(ClientOp.SQL_EXEC, payloadWriter, payloadReader))
+                        .exceptionally(e -> {
+                            Throwable ex = unwrapCause(e);
+                            if (ex instanceof TransactionException) {
+                                var te = (TransactionException) ex;
+                                throw new SqlException(te.traceId(), 
te.code(), te.getMessage(), te);

Review Comment:
   Here you create sql exception with txn error code, which is incorrect.
   I don't think any unwapping is needed on client side. It's already done on 
server.
   Same for line 258



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