• Register
0 votes

resolve com.amazonaws.services.dynamodbv2.model.ConditionalCheckFailedException

I have a table with version attribute.

I see an issue where in the first-time save is given an optimistic lock failure exception while trying to insert new record into com.amazonaws.services.dynamodbv2.model.ConditionalCheckFailedException: The conditional request failed (Service: AmazonDynamoDBv2; Status Code: 400; Error Code: ConditionalCheckFailedException;table using DynamoDBMapper.save method.



asked by

1 Answer

0 votes
Use DynamoDbMapperConfig Save type as CLOBBER, which means to say DynamoDB that erase any existing version and do not complain of version integrity.
The Save OPERATION in CLOBBER mode will initialize the version number to 1.
answered by (860 points)