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ヶ月前333ビュー
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ヶ月前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ