DynamoDBMapper, the higher-level Java interface for Amazon DynamoDB, now helps developers ensure that transactional writes are being performed on the most recent version of an item by using optimistic locking.  

from Recent Announcements https://aws.amazon.com/about-aws/whats-new/2019/10/dynamodbmapper-now-supports-optimistic-locking-for-amazon-dynamodb-transactional-api-calls/