Open
Description
Describe the issue
Need to upgrade SDK version to 2 for DDB client. I want to understand how to enforce optimistic locking while doing CRUD operation by enhanced DDB client. I am already using @DynamoDbVersionAttribute annotation.
Steps to Reproduce
- Insert item using TransactWriteItemsEnhancedRequest - PutItem.
- Fetch the item using table.getItem(GetItemEnhancedRequest). (recordVersion would be 1)
- Update one field of item using TransactWriteItemsEnhancedRequest - UpdateItem. (recordVersion will updated to 2 in the DDB.)
- Delete item using TransactWriteItemsEnhancedRequest - DeleteItem but use object fetched from Step 2 for deletion.
Current Behavior
Item is deleted successfully without any exception for record number mismatch.
Your Environment
- AWS Java SDK version used: 2
- JDK version used: 11
- Operating System and version: macOS 10.15.7