ascherbakoff commented on a change in pull request #400:
URL: https://github.com/apache/ignite-3/pull/400#discussion_r756807324
##########
File path:
modules/api/src/main/java/org/apache/ignite/tx/IgniteTransactions.java
##########
@@ -19,24 +19,55 @@
import java.util.concurrent.CompletableFuture;
import java.util.function.Consumer;
+import java.util.function.Function;
/**
* Ignite Transactions facade.
*/
public interface IgniteTransactions {
+ /**
+ * Returns a facade with new default timeout.
+ *
+ * @param timeout The timeout.
+ *
+ * @return A facade using a new timeout.
+ */
+ IgniteTransactions withTimeout(long timeout);
+
/**
* Begins a transaction.
*
- * @return The future.
+ * @return The started transaction.
+ */
+ Transaction begin();
+
+ /**
+ * Begins an async transaction.
+ *
+ * @return The future holding the started transaction.
*/
CompletableFuture<Transaction> beginAsync();
/**
- * Synchronously executes a closure within a transaction.
+ * Executes a closure within a transaction.
*
- * <p>If the closure is executed normally (no exceptions), the transaction
is automatically committed.
+ * <p>If the closure is executed normally (no exceptions) the transaction
is automatically committed.
*
* @param clo The closure.
*/
void runInTransaction(Consumer<Transaction> clo);
Review comment:
1) Any runtime exception can be thrown here. TransactionException can be
thrown as well. I can't list them all.
2) This question is strange. Anything can happen according to user code.
Javadoc has a mention of exception impact on a transaction.
--
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]