You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Alexey Scherbakov (Jira)" <ji...@apache.org> on 2022/10/10 11:19:00 UTC

[jira] [Updated] (IGNITE-17839) Improve semantics of implicit txn management for async transactions

     [ https://issues.apache.org/jira/browse/IGNITE-17839?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alexey Scherbakov updated IGNITE-17839:
---------------------------------------
    Release Note: New API for async implicit transactions: runInTransactionAsync  (was: TBD)

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