korlov42 commented on code in PR #7099:
URL: https://github.com/apache/ignite-3/pull/7099#discussion_r2579864212


##########
modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/tx/ScriptTransactionWrapperImpl.java:
##########
@@ -94,6 +98,17 @@ public CompletableFuture<Void> finalise(Throwable error) {
 
             rollbackCause = error;
             txState = State.ROLLBACK;
+
+            cursorsToClose = List.copyOf(openedCursors.values());
+        }
+
+        // Close all associated cursors on error.
+        for (CompletableFuture<? extends AsyncCursor<?>> fut : cursorsToClose) 
{
+            fut.whenComplete((cursor, ex) -> {
+                if (cursor != null) {
+                    cursor.closeAsync();

Review Comment:
   it's better to use `cursor.cancelAsync(CancellationReason.CANCEL)`.
   
   Btw, does it make sense to wait for completion before terminating the 
transaction?



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