ygerzhedovich commented on code in PR #2972:
URL: https://github.com/apache/ignite-3/pull/2972#discussion_r1431092554
##########
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:
What is I affraid we will have different implementation (erromessage, code,
....) on server side and client side in a time. Can we do it by another way?
--
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]