tkalkirill commented on code in PR #13080:
URL: https://github.com/apache/ignite/pull/13080#discussion_r3154222072


##########
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 IllegalArgumentException 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 IllegalArgumentException 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.
+     *
+     * @param name Savepoint name.
+     * @throws IllegalArgumentException If savepoint with the given name does 
not exist.
+     * @throws IgniteException If savepoints are not supported for this 
transaction.
+     */
+    public void rollbackToSavepoint(String name);
+
+    /**
+     * Releases a savepoint. If savepoint does not exist this operation does 
nothing.
+     * <p>
+     * Releasing a savepoint does not roll back transaction changes. It only 
removes the marker so it can no longer be

Review Comment:
   Let's say we have several save points, say 4, and we release the 3rd one. 
What happens to 1 and 2, will their changes also be released and what happens 
with 4?



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