vldpyatkov commented on code in PR #13080:
URL: https://github.com/apache/ignite/pull/13080#discussion_r3161271312
##########
modules/core/src/main/java/org/apache/ignite/transactions/Transaction.java:
##########
@@ -290,6 +290,57 @@ public interface Transaction extends AutoCloseable,
IgniteAsyncSupport {
*/
public void suspend() throws IgniteException;
+ /**
+ * Creates a savepoint in the current transaction.
+ * <p>
+ * Savepoints are supported only for explicit transactions with
+ * {@link TransactionConcurrency#PESSIMISTIC} concurrency. The savepoint
keeps the current transaction state and can
+ * later be used by {@link #rollbackToSavepoint(String)} to discard
changes made after it was created.
+ *
+ * @param name Savepoint name.
+ * @throws TransactionException If savepoint with the same name already
exists.
+ * @throws IgniteException If savepoints are not supported for this
transaction.
+ */
+ public void savepoint(String name);
+
+ /**
+ * Creates a savepoint in the current transaction.
+ * <p>
+ * Savepoints are supported only for explicit transactions with
+ * {@link TransactionConcurrency#PESSIMISTIC} concurrency. If {@code
overwrite} is {@code true} and a savepoint with
+ * the same name exists, the existing savepoint is replaced with a
snapshot of the current transaction state.
+ *
+ * @param name Savepoint name.
+ * @param overwrite Whether to overwrite an existing savepoint with the
same name.
+ * @throws TransactionException If savepoint with the same name already
exists and {@code overwrite} is
+ * {@code false}.
+ * @throws IgniteException If savepoints are not supported for this
transaction.
+ */
+ public void savepoint(String name, boolean overwrite);
+
+ /**
+ * Rolls back transaction changes to the specified savepoint.
+ * <p>
+ * Changes made after the savepoint was created are discarded. Savepoints
created after the specified savepoint are
+ * released. The transaction remains active and can be committed or rolled
back after this method returns.
Review Comment:
I explained this above in the other comment.
--
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]