ptupitsyn commented on code in PR #3640:
URL: https://github.com/apache/ignite-3/pull/3640#discussion_r1576029209
##########
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:
> It's already done on server.
`Transaction is already finished` exception is thrown by the client in this
case:
https://github.com/apache/ignite-3/blob/a70aef41a3dc56da9437acead50e76d17259967f/modules/client/src/main/java/org/apache/ignite/internal/client/tx/ClientTransaction.java#L167
--
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]