I want to clarify whether the ConditionalCheckFailedException is caused by a condition check or optimistic locking.
It seems that there is a discussion about this issue on https://github.com/aws/aws-sdk-net/issues/1332, but I'm unsure if it has been resolved.
The reason I want to differentiate the ConditionalCheckFailedException is to implement retry logic specifically for cases related to optimistic locking, not for condition checks.
Is there a way to determine if the ConditionalCheckFailedException is due to a condition check or optimistic locking?
Thank you.
Update 1st July 2023
You can choose to return the item in the case of a conditional check failure to understand which condition evaluated to false:
https://aws.amazon.com/about-aws/whats-new/2023/06/amazon-dynamodb-cost-failed-conditional-writes/
https://aws.amazon.com/blogs/database/handle-conditional-write-errors-in-high-concurrency-scenarios-with-amazon-dynamodb/