How to use transaction.commitAsync()?

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

How to use transaction.commitAsync()?

Let's assume I need to update an item in a cache and then invoke
commitAsync(). Is the following a valid code pattern?

Transaction transaction = ignite.transactions().txStart();
cache.putAsync(key, value); // this
cache.put(key, value); // or this
transaction.commitAsync().listen(fut -> /* respond to the caller */);

Thanks!

Kamil
aealexsandrov aealexsandrov
Reply | Threaded
Open this post in threaded view
|

Re: How to use transaction.commitAsync()?