sk0x50 commented on code in PR #7105:
URL: https://github.com/apache/ignite-3/pull/7105#discussion_r2571894656


##########
modules/client-handler/src/main/java/org/apache/ignite/client/handler/requests/table/ClientTableCommon.java:
##########
@@ -457,29 +494,41 @@ public static TableNotFoundException 
tableIdNotFoundException(Integer tableId) {
                 // Attach resource id only on first direct request.
                 resourceIdHolder[0] = resources.put(new ClientResource(tx, 
tx::rollbackAsync));
 
-                return tx;
+                return completedFuture(tx);
             } else if (id == TX_ID_DIRECT) {
+                assert txManager != null : "Transaction manager must be 
specified to process directly mapped requests.";
+                assert tables != null : "Tables manager must be specified to 
process directly mapped requests.";
+
                 // This is direct request mapping.
                 long token = in.unpackLong();
                 UUID txId = in.unpackUuid();
+
+                // TODO https://issues.apache.org/jira/browse/IGNITE-25017
+                // partition awareness feature should be reworked to use zone 
ids.
                 int commitTableId = in.unpackInt();
                 int commitPart = in.unpackInt();
+
                 UUID coord = in.unpackUuid();
                 long timeout = in.unpackLong();
 
-                InternalTransaction remote = txManager.beginRemote(txId, new 
TablePartitionId(commitTableId, commitPart),
-                        coord, token, timeout, err -> {
-                            // Will be called for write txns.
-                            notificationSender.sendNotification(w -> 
w.packUuid(txId), err, NULL_HYBRID_TIMESTAMP);
+                return readTableAsync(commitTableId, tables)
+                        .thenApply(table -> {
+                            InternalTransaction remote = 
txManager.beginRemote(txId, new ZonePartitionId(table.zoneId(), commitPart),
+                                    coord, token, timeout, err -> {
+                                            if (notificationSender != null) {

Review Comment:
   Well, it is a good question. It should be clarified: why might this listener 
be null when processing SQL queries? I will do it next week.



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