DynamoDBLocal support for ReturnValuesOnConditionCheckFailure for single write operations?

3

Currently this feature is not supported in DynamodbLocal 2.0, and the item returned is null for single write operations (but works for transactions). Is there any plans to add support?

example:

try {
    com.amazonaws.services.dynamodbv2.model.PutItemRequest request2 = new com.amazonaws.services.dynamodbv2.model.PutItemRequest()
            .withTableName(tableName)
            .withItem(Map.of(keyName, new com.amazonaws.services.dynamodbv2.model.AttributeValue(keyValue))) // matches existing document
            .withConditionExpression("attribute_exists(#key)")
            .withExpressionAttributeNames(Map.of("#key", "non_existing_attribute"))
            .withReturnValuesOnConditionCheckFailure("ALL_OLD");
    dynamoDB.putItem(request2);
} catch (final ConditionalCheckFailedException e) {
    System.out.println("Return value: " + e.getItem()); // returns null
}
Arturo
질문됨 8달 전337회 조회
2개 답변
1
수락된 답변

Thanks for submitting this.

It works currently for transactions as that API parameter has existed for some time.

As for singleton operations, I will bring this up with our team internally. Unfortunately I cannot provide an ETA for this feature to be implemented, but it will be implemented in future releases.

profile pictureAWS
전문가
답변함 8달 전
0

Thank you Leeroy! Looking forward to it.

Arturo
답변함 8달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠