Skip to content

DynamoDbEnhancedClient transaction write missing support for return values #2283

Closed
@openwebsolns

Description

@openwebsolns

Support for ReturnValuesOnConditionCheckFailure is missing from the PutItemEnhancedRequest object, but exists in the vanilla PutItemRequest.

Describe the bug

Unlike V1's DynamoDBMapper or V2's plain DynamoDbClient, there is no way to specify returnValues on a put item request in DynamoDbEnhancedClient. Specifically, the PutItemEnhancedRequest object is missing the field which otherwise exists in PutItemRequest.

Expected Behavior

I should be able to specify ALL_OLD (or NONE) for return values in a transaction write using DynamoDbEnhancedClient:

TransactionWriteItemsEnhancedRequest request = TransactionWriteItemsEnhancedRequest.builder()
    .addPutItem(
        itemTable, // MappedTableResource
        PutItemEnhancedRequest.builder()
            .item(someItem)
            .conditionExpression(someExpression)
            .returnValues(ReturnValues.ALL_OLD)    // <<<< MISSING FUNCTIONALITY
            .build()
    ).build();

Current Behavior

There is no way to specify returnValues as can be done in plain PutItemRequest.

Steps to Reproduce

See above.

Possible Solution

Add support as part of the PutItemEnhancedRequest; not sure if depending on services.dynamodb package is considered correct when working in enhanced.dynamodb.

Context

Unable to migrate from DynamoDBMapper in V1 to DynamoDbEnhancedClient because of this missing functionality.

Your Environment

  • AWS Java SDK version used:
  • JDK version used:
  • Operating System and version:

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions