Skip to content

Optimistic Locking while using Enhanced DDB Client - DeleteItem not working #2358

Open
@RushinNaik

Description

@RushinNaik

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

  1. Insert item using TransactWriteItemsEnhancedRequest - PutItem.
  2. Fetch the item using table.getItem(GetItemEnhancedRequest). (recordVersion would be 1)
  3. Update one field of item using TransactWriteItemsEnhancedRequest - UpdateItem. (recordVersion will updated to 2 in the DDB.)
  4. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugThis issue is a bug.dynamodb-enhancedhacktoberfestWe encourage contributions to this issue for Hacktoberfest.p2This is a standard priority issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions