[ 
https://issues.apache.org/jira/browse/IGNITE-24146?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17911006#comment-17911006
 ] 

Pavel Pereslegin commented on IGNITE-24146:
-------------------------------------------

After adding this limitation, we should also mention it in 
{{system-views-api/README.md}} (see {{Basic concepts}} section about 
transactions).

> Sql. Querying system views with explicit transactions should not be possible
> ----------------------------------------------------------------------------
>
>                 Key: IGNITE-24146
>                 URL: https://issues.apache.org/jira/browse/IGNITE-24146
>             Project: Ignite
>          Issue Type: Improvement
>          Components: sql
>            Reporter: Maksim Zhuravkov
>            Priority: Major
>              Labels: ignite-3
>
> Because system views do not support transaction at the moment (they basically 
> run at dirty reads isolation level), all queries and scripts in the example 
> below work.
> Let's update statement validation logic to reject transactions that refer 
> system views and run within explicit transactions.
> {code:java}
>     @Test
>     public void test() {
>         {
>             Transaction tx = igniteTx().begin(new 
> TransactionOptions().readOnly(true));
>             sql(tx, "SELECT * FROM system.system_views");
>             tx.commit();
>         }
>         {
>             Transaction tx = igniteTx().begin(new 
> TransactionOptions().readOnly(false));
>             sql(tx, "SELECT * FROM system.system_views");
>             tx.commit();
>         }
>         {
>             igniteSql().executeScript("START TRANSACTION; SELECT * FROM 
> system.system_views; COMMIT");
>             igniteSql().executeScript("START TRANSACTION READ ONLY; SELECT * 
> FROM system.system_views; COMMIT");
>             igniteSql().executeScript("START TRANSACTION READ WRITE; SELECT * 
> FROM system.system_views; COMMIT");
>         }
>     }
> {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to