awslabs / awslabs/amazon-dynamodb-local-samples
@DynamoDbVersionAttribute causing table.putItem to fail
- Dominant language
- Java
- Stars
- 28
- Forks
- 16
- PR merge metrics
- No merged PRs in 30d
Description
I have this DynamoDbBean with this DynamoDbVersionAttribute for optimistic locking.
```
@DynamoDbVersionAttribute
public Long getVersion() {
return version;
}
public void setVersion(Long version) {
this.version = version;
}
```
when I call table.putItem() on it it fails. But if I comment out the @DynamoDbVersionAttribute it saves fine. I've tried saving with the version set to a value and version set to null.
I am using the Java V2 sdk and DynamoDBLocal V3. It worked before using mapper.save with java sdk v1 andDynamoDBLocal v1
Contributor guide
Research direction
Start with the DynamoDbBean version getter and the table.putItem call described in the issue, then reproduce the failure against DynamoDBLocal V3 with the Java SDK V2. Compare behavior with the SDK V1 mapper.save path. Done means identifying why @DynamoDbVersionAttribute causes the write to fail and confirming the corrected behavior with both null and populated versions.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, java
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 28/100