IGNITE-4188, thoughts about realisation

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

IGNITE-4188, thoughts about realisation

Dmitrii Ryabov
Hello, community.

try (Transaction tx = ignite.transactions().txStart()) {
    c.put(1, 1);

    tx.savepoint("mysavepoint");

    c.put(2, 2);

    tx.rollbackToSavepoint("mysavepoint");

    c.put(3, 3);

    tx.commit();
}


I want to make it in such way:

When user calls tx.savepoint(""), Transaction delegate call to
IgniteInternalTx, which delegate it to its IgniteTxState.

IgniteTxState implementation will contain stack of savepoints, where
Savepoint is class containing snapshot of cache entries and any important
additional information.

What do you think?
Reply | Threaded
Open this post in threaded view
|

Re: IGNITE-4188, thoughts about realisation

dmagda
Sam, Yakov, Alex G.,

Could you chime in and discuss implementation details with Dmitriy S. to make sure he is not moving in a wrong direction?



Denis

> On Mar 31, 2017, at 9:34 AM, Дмитрий Рябов <[hidden email]> wrote:
>
> Hello, community.
>
> try (Transaction tx = ignite.transactions().txStart()) {
>    c.put(1, 1);
>
>    tx.savepoint("mysavepoint");
>
>    c.put(2, 2);
>
>    tx.rollbackToSavepoint("mysavepoint");
>
>    c.put(3, 3);
>
>    tx.commit();
> }
>
>
> I want to make it in such way:
>
> When user calls tx.savepoint(""), Transaction delegate call to
> IgniteInternalTx, which delegate it to its IgniteTxState.
>
> IgniteTxState implementation will contain stack of savepoints, where
> Savepoint is class containing snapshot of cache entries and any important
> additional information.
>
> What do you think?