[
https://issues.apache.org/jira/browse/IGNITE-17839?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17616452#comment-17616452
]
Alexander Lapin commented on IGNITE-17839:
------------------------------------------
[~ascherbakov] LGTM
> Improve semantics of implicit txn management for async transactions
> -------------------------------------------------------------------
>
> Key: IGNITE-17839
> URL: https://issues.apache.org/jira/browse/IGNITE-17839
> Project: Ignite
> Issue Type: Improvement
> Reporter: Alexey Scherbakov
> Assignee: Alexey Scherbakov
> Priority: Major
> Labels: ignite-3
> Fix For: 3.0
>
> Time Spent: 1h 50m
> Remaining Estimate: 0h
>
> There is a usability issue for transaction implicit management API.
> For async transaction tx.commit must be called after all async ops are
> enlisted to the transaction. This is a responsibility of a user in case of
> explicit management.
> But, for implicit management, tx.commit must be called automatically. This is
> not generally not possible for async flows, because by the end of a closure
> some operations are not yet started.
> The example:
> runInTransactionAsync(tx -> {
> return opAsync().thenComposeAsync(res -> otherOpAsync());
> })
> We can fix this by introducing async context for implicit management and
> require a user to return last completion stage in the chain, like:
> <T> CompletableFuture<T> runInTransactionAsync(Function<Transaction,
> CompletableFuture<T>> clo);
--
This message was sent by Atlassian Jira
(v8.20.10#820010)