ptupitsyn commented on code in PR #2972:
URL: https://github.com/apache/ignite-3/pull/2972#discussion_r1431107132


##########
modules/client/src/main/java/org/apache/ignite/internal/client/tx/ClientTransaction.java:
##########
@@ -134,6 +153,23 @@ public static ClientTransaction get(Transaction tx) {
                     + "'. Use IgniteClient.transactions() to start 
transactions.");
         }
 
-        return (ClientTransaction) tx;
+        ClientTransaction clientTx = (ClientTransaction) tx;
+
+        var state = clientTx.state.get();
+
+        if (state == STATE_OPEN) {
+            return clientTx;
+        }
+
+        // Match org.apache.ignite.internal.tx.TxState enum:
+        String stateStr = state == STATE_COMMITTED ? "COMMITTED" : "ABORTED";
+
+        throw new TransactionException(

Review Comment:
   We have tests that run against client and embedded APIs to ensure consistent 
behavior (`ItSqlSynchronousApiTest` & `ItSqlClientSynchronousApiTest`, etc).
   
   It would be great to rely on the server only for this, but when the tx is 
finished, the server removes it from `ClientResourceRegistry` and we can't use 
it anymore from the client.



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