nizhikov commented on code in PR #13116:
URL: https://github.com/apache/ignite/pull/13116#discussion_r3208600976
##########
docs/_docs/SQL/sql-calcite.adoc:
##########
@@ -483,3 +427,54 @@ Disables certain optimizer rules. This is an optimizer
level hint.
----
SELECT /*+ DISABLE_RULE('MergeJoinConverter') */ T1.* FROM TBL1 T1 JOIN TBL2
T2 ON T1.V1=T2.V1 WHERE T2.V2=?
----
+
+== Transactions [[transactions]]
+
+Transactions on `READ_COMMITTED` isolation level are supported for SQL queries
in Calcite query engine.
+To ensure backward compatibility transactions support disabled, by default.
+To enable, please, configure like the following:
+
+[tabs]
+--
+tab:XML[]
+[source,xml]
+----
+<bean class="org.apache.ignite.configuration.IgniteConfiguration">
+ <property name="transactionConfiguration">
+ <bean class="org.apache.ignite.configuration.TransactionConfiguration">
+ <property name="txAwareQueriesEnabled" value="true" />
+ ...
+ </bean>
+ </property>
+ ...
+</bean>
+----
+--
+
+The following API "transactional aware":
+
+* key-value API.
+* SQL queries with Calcite engine.
+* Scan queries.
+
+"Transactional aware" means:
+
+1. ACID in the same way as key-value API.
+2. Any data changed or removed by the query will not be visible to the
concurrent query until transaction committed.
+3. Any data changed by the query will be returned updated by subsequent
queries of the same transaction.
Review Comment:
Please, see example:
```
try (Transaction tx = ignite.transactions.start()) {
cache.put(1, "test");
var res = sql("SELECT _VAL FROM cache WHERE _KEY = 1");
}
```
If `txAwareQueriesEnabled == false' SELECT will return empty result,
because, transaction not committed.
But, if `txAwareQueriesEnabled == true' SELECT will return "test" row.
--
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]