awslabs / awslabs/amazon-dynamodb-local-samples

@DynamoDbVersionAttribute causing table.putItem to fail

Open
#32 1 comment 0 reactions 0 assignees View on GitHub
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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.