We are using the DynamoDB transaction API to perform 2 writes:
TransactWriteItemsRequest transactionalWriteRequest = new TransactWriteItemsRequest();
transactionalWriteRequest.withTransactItems(writeOne, writeTwo);
dynamoDB.transactWriteItems(transactionalWriteRequest);
If the transaction fails with a TransactionCanceledException we get back an exception with a list of CancellationReason objects.
In my scenario, imagine writeOne and writeTwo both fail. The exception will return two cancellation reasons.
My question is - does the ordering of those reasons match the ordering of the transactions in my request.
Is this always true?
// Explains why writeOne failed
transactionError.getCancellationReasons().get(0);
// Explains why writeTwo failed
transactionError.getCancellationReasons().get(1);
Thanks