ignite-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Evgenii Zhuravlev <e.zhuravlev...@gmail.com>
Subject Re: Transactions and IgniteQueue
Date Fri, 03 Nov 2017 10:40:44 GMT
Hi Arun,

As for now, IgniteTransaction works only for caches. You can find
information about it in documentation:
https://apacheignite.readme.io/docs/transactions#section-ignitetransactions

Evgenii

2017-11-03 12:43 GMT+03:00 arunkjn <arunkjn@gmail.com>:

> Hi,
>
> I am using an optimistic transaction with serializable isolation level on a
> transactional cache as follows-
>
> while (true){
>                 try(Transaction tx =
> ignite.transactions().txStart(TransactionConcurrency.OPTIMISTIC,
> TransactionIsolation.SERIALIZABLE)){
>
>                     // update all keys of workflow run state corresponding
> to this event
>                     flowRunStateIds.stream().forEach(flowRunStateId -> {
>                         FlowRunState state =
> workflowRunStateIgniteCache.get(flowRunStateId);
>                         try {
>                             state.getFlowRunEvents().put(event);
>                         } catch (InterruptedException e) {
>                             e.printStackTrace();
>                         }
>                         workflowRunStateIgniteCache.put(flowRunStateId,
> state);
>                     });
>
>                     updatedFlows.stream().forEach(workflowFlow ->
> updatedFlowsIgniteQueue.put(workflowFlow));
>
>                     tx.commit();
>                     break;
>                 }
>                 catch (TransactionOptimisticException e){
>                     // todo: emit a monitoring metric TRANSACTIONS_FAILED
> here
>                     System.out.println("Transaction failed. Retrying...");
>                 }
>             }
>
> Inside the transaction I am updating the cache values and also updating an
> IgniteQueue updatedFlowsIgniteQueue. If the transaction fails at the time
> of
> commit, the transactional cache will not be updated. Is the same also true
> for IgniteQueue? Also, will my queue be locked during the duration of the
> transaction?
>
> Thanks,
> Arun
>
>
>
> --
> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>

Mime
View raw message