You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by GitBox <gi...@apache.org> on 2023/01/11 13:00:30 UTC

[GitHub] [ignite-3] sergeyuttsel commented on a diff in pull request #1503: IGNITE-18324 Calling tx.rollback() or tx.commit() is not failed for committed transaction.

sergeyuttsel commented on code in PR #1503:
URL: https://github.com/apache/ignite-3/pull/1503#discussion_r1066963011


##########
modules/client/src/main/java/org/apache/ignite/internal/client/tx/ClientTransaction.java:
##########
@@ -34,11 +34,8 @@ public class ClientTransaction implements Transaction {
     /** Open state. */
     private static final int STATE_OPEN = 0;
 
-    /** Committed state. */
-    private static final int STATE_COMMITTED = 1;
-
-    /** Rolled back state. */
-    private static final int STATE_ROLLED_BACK = 2;
+    /** Close state. */
+    private static final int STATE_CLOSE = 1;

Review Comment:
   fixed



##########
modules/client/src/main/java/org/apache/ignite/internal/client/tx/ClientTransaction.java:
##########
@@ -87,7 +84,9 @@ public void commit() throws TransactionException {
     /** {@inheritDoc} */
     @Override
     public CompletableFuture<Void> commitAsync() {
-        setState(STATE_COMMITTED);
+        if (!state.compareAndSet(STATE_OPEN, STATE_CLOSE)) {

Review Comment:
   fixed. Thanks.



-- 
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-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org