diff --git a/modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/exec/ExecutablePlan.java b/modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/exec/ExecutablePlan.java index 0418e27d0d6..02b1e1831fe 100644 --- a/modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/exec/ExecutablePlan.java +++ b/modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/exec/ExecutablePlan.java @@ -45,7 +45,7 @@ AsyncCursor execute( ); /** - * Returns {@code true} if the plan is executed inside a transaction, {@code false} otherwise. + * Returns {@code true} if the plan is to be executed within a transaction (explicit or implicit), {@code false} otherwise. */ boolean transactional(); } diff --git a/modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/exec/ScannableTableImpl.java b/modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/exec/ScannableTableImpl.java index fffcee3c9e6..b24f51b1cec 100644 --- a/modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/exec/ScannableTableImpl.java +++ b/modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/exec/ScannableTableImpl.java @@ -221,7 +221,7 @@ public Publisher indexLookup( @Override public CompletableFuture primaryKeyLookup( ExecutionContext ctx, - @Nullable InternalTransaction explicitTx, + InternalTransaction tx, RowFactory rowFactory, RowT key, BitSet requiredColumns @@ -230,7 +230,7 @@ public CompletableFuture primaryKeyLookup( BinaryRowEx keyRow = converter.toKeyRow(ctx, key); - return internalTable.get(keyRow, explicitTx) + return internalTable.get(keyRow, tx) .thenApply(tableRow -> { if (tableRow == null) { return null; diff --git a/modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/exec/UpdatableTableImpl.java b/modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/exec/UpdatableTableImpl.java index c2d7bfaaa23..b8ce4942ed0 100644 --- a/modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/exec/UpdatableTableImpl.java +++ b/modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/exec/UpdatableTableImpl.java @@ -62,7 +62,6 @@ import org.apache.ignite.internal.tx.InternalTransaction; import org.apache.ignite.internal.util.IgniteUtils; import org.apache.ignite.sql.SqlException; -import org.jetbrains.annotations.Nullable; /** * Ignite table implementation. @@ -200,7 +199,7 @@ public TableDescriptor descriptor() { /** {@inheritDoc} */ @Override public CompletableFuture insert( - @Nullable InternalTransaction explicitTx, + InternalTransaction tx, ExecutionContext ectx, RowT row ) { @@ -213,7 +212,7 @@ public CompletableFuture insert( BinaryRowEx tableRow = rowConverter.toFullRow(ectx, validatedRow); - return table.insert(tableRow, explicitTx) + return table.insert(tableRow, tx) .thenApply(success -> { if (success) { return null; diff --git a/modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/prepare/KeyValueGetPlan.java b/modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/prepare/KeyValueGetPlan.java index d65afdcd0ca..732b487cd15 100644 --- a/modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/prepare/KeyValueGetPlan.java +++ b/modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/prepare/KeyValueGetPlan.java @@ -136,7 +136,7 @@ public IgniteKeyValueGet lookupNode() { @Override public AsyncCursor execute( ExecutionContext ctx, - @Nullable InternalTransaction tx, + InternalTransaction tx, ExecutableTableRegistry tableRegistry, @Nullable QueryPrefetchCallback firstPageReadyCallback ) { diff --git a/modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/prepare/KeyValueModifyPlan.java b/modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/prepare/KeyValueModifyPlan.java index e00453b15a8..9793a17b845 100644 --- a/modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/prepare/KeyValueModifyPlan.java +++ b/modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/prepare/KeyValueModifyPlan.java @@ -121,7 +121,7 @@ public IgniteKeyValueModify modifyNode() { @Override public AsyncCursor execute( ExecutionContext ctx, - @Nullable InternalTransaction tx, + InternalTransaction tx, ExecutableTableRegistry tableRegistry, @Nullable QueryPrefetchCallback firstPageReadyCallback ) { diff --git a/modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/tx/QueryTransactionContextImpl.java b/modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/tx/QueryTransactionContextImpl.java index cd1e79e1176..46547a82e63 100644 --- a/modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/tx/QueryTransactionContextImpl.java +++ b/modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/tx/QueryTransactionContextImpl.java @@ -59,12 +59,7 @@ public QueryTransactionWrapper getOrStartImplicit(boolean readOnly, boolean tabl if (tx == null) { transaction = txManager.begin(observableTimeTracker, tableDriven, readOnly); - - if (tableDriven) { - result = new TableDrivenImplicitTransactionWrapper(transaction, txTracker); - } else { - result = new QueryTransactionWrapperImpl(transaction, true, txTracker); - } + result = new QueryTransactionWrapperImpl(transaction, true, txTracker); } else { transaction = tx.unwrap(); result = tx; diff --git a/modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/tx/ScriptTransactionContext.java b/modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/tx/ScriptTransactionContext.java index 31811d238e9..be35fb819ed 100644 --- a/modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/tx/ScriptTransactionContext.java +++ b/modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/tx/ScriptTransactionContext.java @@ -58,7 +58,7 @@ public ScriptTransactionContext( * Starts a new implicit transaction if there is no external or script-driven transaction. * * @param readOnly Indicates whether the read-only transaction or read-write transaction should be started. - * @param tableDriven Indicates whether the implicit transaction will be managed by the table manager or the SQL engine. + * @param tableDriven Indicates whether the implicit transaction will be partially managed by the table storage. * @return Transaction wrapper. */ @Override diff --git a/modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/tx/TableDrivenImplicitTransactionWrapper.java b/modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/tx/TableDrivenImplicitTransactionWrapper.java deleted file mode 100644 index 28b9acee179..00000000000 --- a/modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/tx/TableDrivenImplicitTransactionWrapper.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.ignite.internal.sql.engine.tx; - -import java.util.concurrent.CompletableFuture; -import org.apache.ignite.internal.sql.engine.exec.TransactionTracker; -import org.apache.ignite.internal.tx.InternalTransaction; -import org.apache.ignite.internal.util.CompletableFutures; - -/** - * Transaction wrapper for table-driven implicit transaction. - */ -public class TableDrivenImplicitTransactionWrapper extends QueryTransactionWrapperImpl { - TableDrivenImplicitTransactionWrapper(InternalTransaction transaction, TransactionTracker txTracker) { - super(transaction, true, txTracker); - } - - @Override - public CompletableFuture commitImplicit() { - return CompletableFutures.nullCompletedFuture(); - } -}