I have a Java function that updates a DynamoDB element. I want to handle the case when the update failed for some reason. My code looks something like this:
Table table = dynamoDB.getTable(tableName); AttributeUpdate att = new attributeUpdate(fieldName).put(value); UpdateItemOutcome outcome = table.updateItem(keyFieldName, keyValue, att);
The result of calling updateItem is an UpdateItemOutcome object. All of this is the getItem () method, which should provide the returned attributes from the update operation, and the getUpdateItemResult () method, which provides the UpdateItemResult object.
getItem () gives me null even when the call succeeds. The UpdateItemResult object does not seem to have any method that provides me with any status or error regarding the operation.
Does anyone know what is best for checking the result of such operations in DynamoDB? This question also applies to putItem () operations.
Thanks!
source share